Patchwork [3,of,5,v2] hghave: use checkrange for svn13/15

login
register
mail settings
Submitter timeless@mozdev.org
Date April 1, 2016, 10:25 p.m.
Message ID <34bee8cb756c78879359.1459549523@waste.org>
Download mbox | patch
Permalink /patch/14241/
State Changes Requested
Headers show

Comments

timeless@mozdev.org - April 1, 2016, 10:25 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1459515881 0
#      Fri Apr 01 13:04:41 2016 +0000
# Node ID 34bee8cb756c7887935989ea2d2004ddfe1c29cb
# Parent  33d33a5d4a8a438aa7e7d0074964dd85865462d9
hghave: use checkrange for svn13/15

Patch

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -244,13 +244,10 @@ 
         return (0, 0)
     return (int(m.group(1)), int(m.group(2)))
 
-@check("svn15", "subversion client and admin tools >= 1.5")
-def has_svn15():
-    return getsvnversion() >= (1, 5)
-
-@check("svn13", "subversion client and admin tools >= 1.3")
-def has_svn13():
-    return getsvnversion() >= (1, 3)
+@checkrange("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():