Patchwork [5,of,6,v3] hghave: use checkvers for bzr114

login
register
mail settings
Submitter timeless@mozdev.org
Date April 4, 2016, 2:20 a.m.
Message ID <6589202019dbd402d2b7.1459736453@waste.org>
Download mbox | patch
Permalink /patch/14316/
State Accepted
Headers show

Comments

timeless@mozdev.org - April 4, 2016, 2:20 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1459516769 0
#      Fri Apr 01 13:19:29 2016 +0000
# Node ID 6589202019dbd402d2b7fb6f8609ebba48c7f053
# Parent  fe03b080d45d183d8fc6c0b56aa91a40d4ecb641
hghave: use checkvers for bzr114

Patch

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -114,12 +114,13 @@ 
     except ImportError:
         return False
 
-@check("bzr114", "Canonical's Bazaar client >= 1.14")
-def has_bzr114():
+@checkvers("bzr", "Canonical's Bazaar client >= %s", (1.14,))
+def has_bzr_range(v):
+    major, minor = v.split('.')[0:2]
     try:
         import bzrlib
         return (bzrlib.__doc__ is not None
-                and bzrlib.version_info[:2] >= (1, 14))
+                and bzrlib.version_info[:2] >= (int(major), int(minor)))
     except ImportError:
         return False