mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
convert dict(zip(x,x)) to dict.fromkeys(x)
This commit is contained in:
parent
fc94bcf116
commit
9297d4db5f
@ -140,7 +140,7 @@ def matchpats(repo, pats=[], opts={}, head=''):
|
||||
|
||||
def walk(repo, pats=[], opts={}, node=None, head='', badmatch=None):
|
||||
files, matchfn, anypats = matchpats(repo, pats, opts, head)
|
||||
exact = dict(zip(files, files))
|
||||
exact = dict.fromkeys(files)
|
||||
for src, fn in repo.walk(node=node, files=files, match=matchfn,
|
||||
badmatch=badmatch):
|
||||
yield src, fn, util.pathto(repo.getcwd(), fn), fn in exact
|
||||
|
@ -106,7 +106,7 @@ def walkchangerevs(ui, repo, pats, change, opts):
|
||||
|
||||
if not slowpath and not files:
|
||||
# No files, no patterns. Display all revs.
|
||||
wanted = dict(zip(revs, revs))
|
||||
wanted = dict.fromkeys(revs)
|
||||
copies = []
|
||||
if not slowpath:
|
||||
# Only files, no patterns. Check the history of each file.
|
||||
@ -210,7 +210,7 @@ def walkchangerevs(ui, repo, pats, change, opts):
|
||||
ff = followfilter()
|
||||
stop = min(revs[0], revs[-1])
|
||||
for x in xrange(rev, stop-1, -1):
|
||||
if ff.match(x) and wanted.has_key(x):
|
||||
if ff.match(x) and x in wanted:
|
||||
del wanted[x]
|
||||
|
||||
def iterate():
|
||||
|
Loading…
Reference in New Issue
Block a user