From e8fcf600939997d0d77f404ad082728e921a15c3 Mon Sep 17 00:00:00 2001 From: Evan Shaw Date: Wed, 14 Jul 2010 17:17:04 -0700 Subject: [PATCH] codereview: Fix for Mercurial >= 1.6 R=rsc, adg, rsc1 CC=golang-dev https://golang.org/cl/1804041 --- lib/codereview/codereview.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py index 2d0977caaea..750ae871cad 100644 --- a/lib/codereview/codereview.py +++ b/lib/codereview/codereview.py @@ -592,7 +592,11 @@ def getremote(ui, repo, opts): # delete it in an attempt to "help" proxy = os.environ.get('http_proxy') source = hg.parseurl(ui.expandpath("default"), None)[0] - other = hg.repository(cmdutil.remoteui(repo, opts), source) + try: + remoteui = hg.remoteui # hg 1.6 + except: + remoteui = cmdutil.remoteui + other = hg.repository(remoteui(repo, opts), source) if proxy is not None: os.environ['http_proxy'] = proxy return other @@ -2856,7 +2860,7 @@ class MercurialVCS(VersionControlSystem): if not err: self.base_rev = mqparent else: - self.base_rev = RunShell(["hg", "parent", "-q"]).split(':')[1].strip() + self.base_rev = RunShell(["hg", "parents", "-q"]).split(':')[1].strip() def _GetRelPath(self, filename): """Get relative path of a file according to the current directory, given its logical path in the repo."""