Author: dsahlberg
Date: Sat Apr 27 12:41:31 2024
New Revision: 1917382

URL: http://svn.apache.org/viewvc?rev=1917382&view=rev
Log:
Make svn_apply_autoprops.py Windows-compatible.

* contrib/client-side/svn_apply_autoprops.py:
  (): Add default Windows Subversion configuration path.
  (process_autoprop_lines): Use `ON` instead of `*` for boolean properties.
  (filter_walk): Replace `os.spawnvp()` with `subprocess.call()`.

Patch by: Khairul Azhar Kasmiran <[email protected]>

Discussion on dev@:
https://lists.apache.org/thread/p66voozgndlr8qlqrtkbjs6dq0jklooj

Modified:
    subversion/trunk/contrib/client-side/svn_apply_autoprops.py

Modified: subversion/trunk/contrib/client-side/svn_apply_autoprops.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/contrib/client-side/svn_apply_autoprops.py?rev=1917382&r1=1917381&r2=1917382&view=diff
==============================================================================
--- subversion/trunk/contrib/client-side/svn_apply_autoprops.py (original)
+++ subversion/trunk/contrib/client-side/svn_apply_autoprops.py Sat Apr 27 
12:41:31 2024
@@ -28,11 +28,15 @@
 import getopt
 import fnmatch
 import os
+import platform
 import re
+import subprocess
 import sys
 
 # The default path to the Subversion configuration file.
-SVN_CONFIG_FILENAME = os.path.expandvars('$HOME/.subversion/config')
+SVN_CONFIG_FILENAME = os.path.expandvars(
+  r'%APPDATA%\Subversion\config' if platform.system() == 'Windows'
+  else '$HOME/.subversion/config')
 
 # The name of Subversion's private directory in working copies.
 SVN_WC_ADM_DIR_NAME = '.svn'
@@ -112,7 +116,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)]
 
@@ -145,7 +149,7 @@ def filter_walk(autoprop_lines, dirname,
       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))


Reply via email to