Commit 3ca72458 authored by Paolo Giarrusso's avatar Paolo Giarrusso Committed by Russ Cox

codereview: avoid exception in match

R=rsc
CC=golang-dev
https://golang.org/cl/1585041
parent 19783ef4
......@@ -659,6 +659,7 @@ original_match = None
def ReplacementForCmdutilMatch(repo, pats=[], opts={}, globbed=False, default='relpath'):
taken = []
files = []
pats = pats or []
for p in pats:
if p.startswith('@'):
taken.append(p)
......@@ -671,7 +672,7 @@ def ReplacementForCmdutilMatch(repo, pats=[], opts={}, globbed=False, default='r
if cl.files == None:
raise util.Abort("no files in CL " + clname)
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]
return original_match(repo, pats=pats, opts=opts, globbed=globbed, default=default)
def RelativePath(path, cwd):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment