comparison tests/test_rebuildmeta.py @ 916:7e9d805a0e1f

tests: fix regressions introduced by peer classes in hg 2.3
author Bryan O'Sullivan <bryano@fb.com>
date Thu, 19 Jul 2012 16:01:17 -0700
parents 295a8b48e4e2
children 5bacb9c63e3e
comparison
equal deleted inserted replaced
915:d6c47c33f6a2 916:7e9d805a0e1f
32 layout=layout) 32 layout=layout)
33 assert len(self.repo) > 0 33 assert len(self.repo) > 0
34 wc2_path = self.wc_path + '_clone' 34 wc2_path = self.wc_path + '_clone'
35 u = ui.ui() 35 u = ui.ui()
36 src, dest = test_util.hgclone(u, self.wc_path, wc2_path, update=False) 36 src, dest = test_util.hgclone(u, self.wc_path, wc2_path, update=False)
37 src = getattr(src, 'local', lambda: src)()
38 dest = getattr(dest, 'local', lambda: dest)()
37 39
38 # insert a wrapper that prevents calling changectx.children() 40 # insert a wrapper that prevents calling changectx.children()
39 def failfn(orig, ctx): 41 def failfn(orig, ctx):
40 self.fail('calling %s is forbidden; it can cause massive slowdowns ' 42 self.fail('calling %s is forbidden; it can cause massive slowdowns '
41 'when rebuilding large repositories' % orig) 43 'when rebuilding large repositories' % orig)
57 src, dest = test_util.hgclone(u, 59 src, dest = test_util.hgclone(u,
58 self.wc_path, 60 self.wc_path,
59 wc3_path, 61 wc3_path,
60 update=False, 62 update=False,
61 rev=[0]) 63 rev=[0])
64 srcrepo = getattr(src, 'local', lambda: src)()
65 dest = getattr(dest, 'local', lambda: dest)()
62 66
63 # insert a wrapper that prevents calling changectx.children() 67 # insert a wrapper that prevents calling changectx.children()
64 extensions.wrapfunction(context.changectx, 'children', failfn) 68 extensions.wrapfunction(context.changectx, 'children', failfn)
65 69
66 try: 70 try:
81 subdir), ]) 85 subdir), ])
82 finally: 86 finally:
83 # remove the wrapper 87 # remove the wrapper
84 context.changectx.children = origchildren 88 context.changectx.children = origchildren
85 89
86 self._run_assertions(name, stupid, single, src, dest, u) 90 self._run_assertions(name, stupid, single, srcrepo, dest, u)
87 91
88 92
89 def _run_assertions(self, name, stupid, single, src, dest, u): 93 def _run_assertions(self, name, stupid, single, src, dest, u):
90 94
91 self.assertTrue(os.path.isdir(os.path.join(src.path, 'svn')), 95 self.assertTrue(os.path.isdir(os.path.join(src.path, 'svn')),