comparison 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
comparison
equal deleted inserted replaced
1583:f778fdd82c83 1584:2b342625a92a
23 23
24 import time 24 import time
25 25
26 revsymbol = test_util.revsymbol 26 revsymbol = test_util.revsymbol
27 27
28 try:
29 lookuperror = revlog.LookupError
30 except AttributeError:
31 lookuperror = hgerror.LookupError
28 32
29 class PushTests(test_util.TestBase): 33 class PushTests(test_util.TestBase):
30 obsolete_mode_tests = True 34 obsolete_mode_tests = True
31 35
32 def setUp(self): 36 def setUp(self):
348 self.assertEqual(tip['adding_file'].data(), 'foo') 352 self.assertEqual(tip['adding_file'].data(), 'foo')
349 self.assertEqual(tip.parents()[0]['adding_file'].data(), 'foo') 353 self.assertEqual(tip.parents()[0]['adding_file'].data(), 'foo')
350 try: 354 try:
351 self.assertEqual(tip.parents()[0]['adding_file2'].data(), 'foo') 355 self.assertEqual(tip.parents()[0]['adding_file2'].data(), 'foo')
352 assert False, "this is impossible, adding_file2 should not be in this manifest." 356 assert False, "this is impossible, adding_file2 should not be in this manifest."
353 except revlog.LookupError, e: 357 except lookuperror, e:
354 pass 358 pass
355 self.assertEqual(tip.branch(), 'default') 359 self.assertEqual(tip.branch(), 'default')
356 360
357 def test_push_to_branch(self, push=True): 361 def test_push_to_branch(self, push=True):
358 repo = self.repo 362 repo = self.repo