diff tests/test_push_command.py @ 1584:2b342625a92a

test: add compat code for removed revlog.LookupError in test_push_command.py revlog.LookupError was removed recently. If that's not present, we will use error.LookupEror instead. revlog.LookupError was split into three different errors which subclasses error.LookupError, so catching error.LookupError is fine.
author Pulkit Goyal <pulkit@yandex-team.ru>
date Wed, 24 Oct 2018 15:21:09 +0300
parents d55c9d0ba350
children
line wrap: on
line diff
--- a/tests/test_push_command.py
+++ b/tests/test_push_command.py
@@ -25,6 +25,10 @@ import time
 
 revsymbol = test_util.revsymbol
 
+try:
+    lookuperror = revlog.LookupError
+except AttributeError:
+    lookuperror = hgerror.LookupError
 
 class PushTests(test_util.TestBase):
     obsolete_mode_tests = True
@@ -350,7 +354,7 @@ class PushTests(test_util.TestBase):
         try:
             self.assertEqual(tip.parents()[0]['adding_file2'].data(), 'foo')
             assert False, "this is impossible, adding_file2 should not be in this manifest."
-        except revlog.LookupError, e:
+        except lookuperror, e:
             pass
         self.assertEqual(tip.branch(), 'default')