diff tests/hghave @ 14050:9e8a9d45945c stable

subrepo: handle svn tracked/unknown directory collisions This happens more often than expected. Say you have an svn subrepository with python code. Python would have generated unknown .pyc files. Now, you rebase this setup on a revision where a directory containing python code does not exist. Subversion is first asked to remove this directory when updating, but will not because it contains untracked items. Then it will have to bring back the directory after the merge but will fail because it now collides with an untracked directory. Using --force is not very elegant and only works with svn >= 1.5 but the only alternative I can think of is to write our own purge command for subversion.
author Patrick Mezard <pmezard@gmail.com>
date Fri, 04 Mar 2011 14:00:49 +0100
parents c17e4d881722
children 82f0412ef7de
line wrap: on
line diff
--- a/tests/hghave	Fri Apr 29 03:05:48 2011 -0500
+++ b/tests/hghave	Fri Mar 04 14:00:49 2011 +0100
@@ -121,6 +121,15 @@
     except ImportError:
         return False
 
+def getsvnversion():
+    m = matchoutput('svn --version 2>&1', r'^svn,\s+version\s+(\d+)\.(\d+)')
+    if not m:
+        return (0, 0)
+    return (int(m.group(1)), int(m.group(2)))
+
+def has_svn15():
+    return getsvnversion() >= (1, 5)
+
 def has_svn():
     return matchoutput('svn --version 2>&1', r'^svn, version') and \
         matchoutput('svnadmin --version 2>&1', r'^svnadmin, version')
@@ -204,6 +213,7 @@
     "pygments": (has_pygments, "Pygments source highlighting library"),
     "ssl": (has_ssl, "python >= 2.6 ssl module and python OpenSSL"),
     "svn": (has_svn, "subversion client and admin tools"),
+    "svn15": (has_svn15, "subversion client and admin tools >= 1.5"),
     "svn-bindings": (has_svn_bindings, "subversion python bindings"),
     "symlink": (has_symlink, "symbolic links"),
     "tla": (has_tla, "GNU Arch tla client"),