[PATCH 4 of 6 v3] hghave: replace has_svn13/has_svn15 with checkvers

timeless timeless at mozdev.org
Sun Apr 3 22:20:52 EDT 2016


# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1459515881 0
#      Fri Apr 01 13:04:41 2016 +0000
# Node ID fe03b080d45d183d8fc6c0b56aa91a40d4ecb641
# Parent  ceaa098476253c392435f2d62b4bca259e3adb30
hghave: replace has_svn13/has_svn15 with checkvers

This would make it possible to easily add a svn14 or svn16 or...

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -248,13 +248,10 @@
         return (0, 0)
     return (int(m.group(1)), int(m.group(2)))
 
- at check("svn15", "subversion client and admin tools >= 1.5")
-def has_svn15():
-    return getsvnversion() >= (1, 5)
-
- at check("svn13", "subversion client and admin tools >= 1.3")
-def has_svn13():
-    return getsvnversion() >= (1, 3)
+ at checkvers("svn", "subversion client and admin tools >= %s", (1.3, 1.5))
+def has_svn_range(v):
+    major, minor = v.split('.')[0:2]
+    return getsvnversion() >= (int(major), int(minor))
 
 @check("svn", "subversion client and admin tools")
 def has_svn():


More information about the Mercurial-devel mailing list