changeset 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 d6c47c33f6a2
children 6918f60d0e28
files tests/test_fetch_mappings.py tests/test_rebuildmeta.py tests/test_tags.py tests/test_util.py
diffstat 4 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test_fetch_mappings.py
+++ b/tests/test_fetch_mappings.py
@@ -245,6 +245,8 @@ class MapTests(test_util.TestBase):
         ui = self.ui(stupid)
         src, dest = test_util.hgclone(ui, self.wc_path, self.wc_path + '_clone',
                                       update=False)
+        src = getattr(src, 'local', lambda: src)()
+        dest = getattr(dest, 'local', lambda: dest)()
         svncommands.rebuildmeta(ui, dest,
                                 args=[test_util.fileurl(repo_path)])
 
--- a/tests/test_rebuildmeta.py
+++ b/tests/test_rebuildmeta.py
@@ -34,6 +34,8 @@ def _do_case(self, name, stupid, single)
     wc2_path = self.wc_path + '_clone'
     u = ui.ui()
     src, dest = test_util.hgclone(u, self.wc_path, wc2_path, update=False)
+    src = getattr(src, 'local', lambda: src)()
+    dest = getattr(dest, 'local', lambda: dest)()
 
     # insert a wrapper that prevents calling changectx.children()
     def failfn(orig, ctx):
@@ -59,6 +61,8 @@ def _do_case(self, name, stupid, single)
                                   wc3_path,
                                   update=False,
                                   rev=[0])
+    srcrepo = getattr(src, 'local', lambda: src)()
+    dest = getattr(dest, 'local', lambda: dest)()
 
     # insert a wrapper that prevents calling changectx.children()
     extensions.wrapfunction(context.changectx, 'children', failfn)
@@ -83,7 +87,7 @@ def _do_case(self, name, stupid, single)
         # remove the wrapper
         context.changectx.children = origchildren
 
-    self._run_assertions(name, stupid, single, src, dest, u)
+    self._run_assertions(name, stupid, single, srcrepo, dest, u)
 
 
 def _run_assertions(self, name, stupid, single, src, dest, u):
--- a/tests/test_tags.py
+++ b/tests/test_tags.py
@@ -112,6 +112,7 @@ rename a tag
             "You should check that before assuming issues with this test.\n")
         wc2_path = self.wc_path + '2'
         src, dest = test_util.hgclone(repo.ui, self.wc_path, wc2_path, update=False)
+        dest = getattr(dest, 'local', lambda: dest)()
         svncommands.rebuildmeta(repo.ui,
                                dest,
                                args=[test_util.fileurl(repo_path), ])
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -160,11 +160,8 @@ def testui(stupid=False, layout='auto', 
     return u
 
 def dispatch(cmd):
-    try:
-        req = dispatchmod.request(cmd)
-        dispatchmod.dispatch(req)
-    except AttributeError, e:
-        dispatchmod.dispatch(cmd)
+    cmd = getattr(dispatchmod, 'request', lambda x: x)(cmd)
+    dispatchmod.dispatch(cmd)
 
 def rmtree(path):
     # Read-only files cannot be removed under Windows