comparison tests/test_rebuildmeta.py @ 917:6918f60d0e28

Merge hg 2.3 fixes from bos.
author Augie Fackler <raf@durin42.com>
date Sat, 21 Jul 2012 15:31:34 -0500
parents 7e9d805a0e1f
children 5bacb9c63e3e
comparison
equal deleted inserted replaced
913:9fff2b8217b6 917:6918f60d0e28
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')),