1
0
mirror of https://github.com/golang/go synced 2024-11-25 18:07:57 -07:00

undo CL 4675045 / 0e11e08951f7

Breaks Mercurial 1.8.3.

««« original CL description
codereview: fix for Mercurial 1.9

Fixes #2038.

R=rsc, bobbypowers
CC=golang-dev
https://golang.org/cl/4675045
»»»

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4685055
This commit is contained in:
Andrew Gerrand 2011-07-12 09:57:39 +10:00
parent 762ea79057
commit b4f0e8ffd3

View File

@ -75,13 +75,6 @@ except:
def findcommonincoming(repo, remote): def findcommonincoming(repo, remote):
return repo.findcommonincoming(remote) return repo.findcommonincoming(remote)
# in Mercurial 1.9 the cmdutil.match and cmdutil.revpair moved to scmutil
if hgversion >= '1.9':
from mercurial import scmutil
else:
scmutil = cmdutil
oldMessage = """ oldMessage = """
The code review extension requires Mercurial 1.3 or newer. The code review extension requires Mercurial 1.3 or newer.
@ -720,14 +713,14 @@ _change_prolog = """# Change list.
# Get effective change nodes taking into account applied MQ patches # Get effective change nodes taking into account applied MQ patches
def effective_revpair(repo): def effective_revpair(repo):
try: try:
return scmutil.revpair(repo, ['qparent']) return cmdutil.revpair(repo, ['qparent'])
except: except:
return scmutil.revpair(repo, None) return cmdutil.revpair(repo, None)
# Return list of changed files in repository that match pats. # Return list of changed files in repository that match pats.
# Warn about patterns that did not match. # Warn about patterns that did not match.
def matchpats(ui, repo, pats, opts): def matchpats(ui, repo, pats, opts):
matcher = scmutil.match(repo, pats, opts) matcher = cmdutil.match(repo, pats, opts)
node1, node2 = effective_revpair(repo) node1, node2 = effective_revpair(repo)
modified, added, removed, deleted, unknown, ignored, clean = repo.status(node1, node2, matcher, ignored=True, clean=True, unknown=True) modified, added, removed, deleted, unknown, ignored, clean = repo.status(node1, node2, matcher, ignored=True, clean=True, unknown=True)
return (modified, added, removed, deleted, unknown, ignored, clean) return (modified, added, removed, deleted, unknown, ignored, clean)
@ -966,11 +959,6 @@ def ReplacementForCmdutilMatch(repo, pats=None, opts=None, globbed=False, defaul
raise util.Abort("no files in CL " + clname) raise util.Abort("no files in CL " + clname)
files = Add(files, cl.files) files = Add(files, cl.files)
pats = Sub(pats, taken) + ['path:'+f for f in files] pats = Sub(pats, taken) + ['path:'+f for f in files]
# work-around for http://selenic.com/hg/rev/785bbc8634f8
if not hasattr(repo, 'match'):
repo = repo[None]
return original_match(repo, pats=pats, opts=opts, globbed=globbed, default=default) return original_match(repo, pats=pats, opts=opts, globbed=globbed, default=default)
def RelativePath(path, cwd): def RelativePath(path, cwd):
@ -1304,7 +1292,7 @@ def clpatch_or_undo(ui, repo, clname, opts, mode):
# sequence numbers get to be 7 digits long. # sequence numbers get to be 7 digits long.
if re.match('^[0-9]{7,}$', clname): if re.match('^[0-9]{7,}$', clname):
found = False found = False
matchfn = scmutil.match(repo, [], {'rev': None}) matchfn = cmdutil.match(repo, [], {'rev': None})
def prep(ctx, fns): def prep(ctx, fns):
pass pass
for ctx in cmdutil.walkchangerevs(repo, matchfn, {'rev': None}, prep): for ctx in cmdutil.walkchangerevs(repo, matchfn, {'rev': None}, prep):
@ -1619,8 +1607,8 @@ def reposetup(ui, repo):
global original_match global original_match
if original_match is None: if original_match is None:
start_status_thread() start_status_thread()
original_match = scmutil.match original_match = cmdutil.match
scmutil.match = ReplacementForCmdutilMatch cmdutil.match = ReplacementForCmdutilMatch
RietveldSetup(ui, repo) RietveldSetup(ui, repo)
def CheckContributor(ui, repo, user=None): def CheckContributor(ui, repo, user=None):
@ -1840,7 +1828,7 @@ def sync_changes(ui, repo):
break break
Rev(rev) Rev(rev)
else: else:
matchfn = scmutil.match(repo, [], {'rev': None}) matchfn = cmdutil.match(repo, [], {'rev': None})
def prep(ctx, fns): def prep(ctx, fns):
pass pass
for ctx in cmdutil.walkchangerevs(repo, matchfn, {'rev': None}, prep): for ctx in cmdutil.walkchangerevs(repo, matchfn, {'rev': None}, prep):