changeset 570:880ef2ac1e0d

Merge change from Felix Schwarz
author Augie Fackler <durin42@gmail.com>
date Mon, 01 Mar 2010 17:39:00 -0600
parents 95eca255739e (diff) f74c8e98e3d2 (current diff)
children f3e5ef8760cb
files
diffstat 2 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/svnwrap/svn_swig_wrapper.py
+++ b/hgsubversion/svnwrap/svn_swig_wrapper.py
@@ -22,10 +22,14 @@ from svn import ra
 from mercurial import util as hgutil
 
 def version():
-    return '%d.%d.%d' % (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_MICRO)
-
-if (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_MICRO) < (1, 5, 0): #pragma: no cover
-    raise ImportError, 'You must have Subversion 1.5.0 or newer and matching SWIG bindings.'
+    return '%d.%d.%d' % (core.SVN_VER_MAJOR, core.SVN_VER_MINOR,
+                         core.SVN_VER_MICRO)
+
+if (core.SVN_VER_MAJOR, core.SVN_VER_MINOR,
+    core.SVN_VER_MICRO) < (1, 5, 0): #pragma: no cover
+    raise ImportError, ('You must have Subversion 1.5.0 or newer and '
+                        'matching SWIG bindings. You appear to'
+                        ' have %s' % version())
 
 class SubversionRepoCanNotReplay(Exception):
     """Exception raised when the svn server is too old to have replay.
--- a/tests/test_fetch_command.py
+++ b/tests/test_fetch_command.py
@@ -69,10 +69,13 @@ class TestBasicRepoLayout(test_util.Test
         self._many_special_cases_checks(repo)
 
     def _many_special_cases_checks(self, repo):
-        self.assertEqual(node.hex(repo[0].node()),
+        self.assertEquals(node.hex(repo[0].node()),
                          '434ed487136c1b47c1e8f952edb4dc5a8e6328df')
-        self.assertEqual(node.hex(repo['tip'].node()),
-                         'b7bdc73041b1852563deb1ef3f4153c2fe4484f2')
+        # two possible hashes for bw compat to hg < 1.5, since hg 1.5
+        # sorts entries in extra()
+        self.assertTrue(node.hex(repo['tip'].node()) in
+                         ('e92012d8c170a0236c84166167f149c2e28548c6',
+                         'b7bdc73041b1852563deb1ef3f4153c2fe4484f2'))
         self.assertEqual(node.hex(repo['the_branch'].node()),
                          '4e256962fc5df545e2e0a51d0d1dc61c469127e6')
         self.assertEqual(node.hex(repo['the_branch'].parents()[0].node()),