I've reattached the patch as a .txt file.
On 2024/04/23 10:46:41 Khairul Azhar Kasmiran wrote:
> Hi everyone!
>
> This is a patch to make `contrib/client-side/svn_apply_autoprops.py`
> Windows-compatible -- I have just found out that `git svn` doesn't
> honor autoprops.
>
> The changes are:
> 1. Replacing `os.spawnvp()` with `subprocess.call()` since
> `os.spawnvp()` isn't supported on Windows.
> 2. Using `ON` instead of `*` for boolean properties like
> `svn:executable` since for some reason, `*` becomes a wildcard on
> Windows.
>
> I have tested this with Python 2.7.18 on Windows and Ubuntu 22.04.4.
>
> [[[
> Make svn_apply_autoprops.py Windows-compatible.
>
> * contrib/client-side/svn_apply_autoprops.py
> (process_autoprop_lines): Use `ON` instead of `*` for boolean properties.
> (filter_walk): Replace `os.spawnvp()` with `subprocess.call()`.
> ]]]
>
> Best regards,
> Khairul
>
Index: contrib/client-side/svn_apply_autoprops.py
===================================================================
--- contrib/client-side/svn_apply_autoprops.py (revision 1917278)
+++ contrib/client-side/svn_apply_autoprops.py (working copy)
@@ -28,6 +28,7 @@ import getopt
import fnmatch
import os
import re
+import subprocess
import sys
# The default path to the Subversion configuration file.
@@ -111,7 +112,7 @@ def process_autoprop_lines(lines):
prop_value = prop_value.strip()
except ValueError:
prop_name = prop
- prop_value = '*'
+ prop_value = 'ON'
if len(prop_name):
props_list += [(prop_name, prop_value)]
@@ -144,7 +145,7 @@ def filter_walk(autoprop_lines, dirname, filenames
for f in matching_filenames:
command += ["%s/%s" % (dirname, f)]
- status = os.spawnvp(os.P_WAIT, 'svn', command)
+ status = subprocess.call(command)
if status:
print('Command %s failed with exit status %s' \
% (command, status))