mercurial/cmdutil.py
changeset 4525 78b6add1f966
parent 4522 591322269fed
child 4548 c9fcebbfc422
equal deleted inserted replaced
4524:6c58139f4eaa 4525:78b6add1f966
   143 def walk(repo, pats=[], opts={}, node=None, badmatch=None, globbed=False,
   143 def walk(repo, pats=[], opts={}, node=None, badmatch=None, globbed=False,
   144          default=None):
   144          default=None):
   145     files, matchfn, anypats = matchpats(repo, pats, opts, globbed=globbed,
   145     files, matchfn, anypats = matchpats(repo, pats, opts, globbed=globbed,
   146                                         default=default)
   146                                         default=default)
   147     exact = dict.fromkeys(files)
   147     exact = dict.fromkeys(files)
       
   148     cwd = repo.getcwd()
   148     for src, fn in repo.walk(node=node, files=files, match=matchfn,
   149     for src, fn in repo.walk(node=node, files=files, match=matchfn,
   149                              badmatch=badmatch):
   150                              badmatch=badmatch):
   150         yield src, fn, util.pathto(repo.root, repo.getcwd(), fn), fn in exact
   151         yield src, fn, repo.pathto(fn, cwd), fn in exact
   151 
   152 
   152 def findrenames(repo, added=None, removed=None, threshold=0.5):
   153 def findrenames(repo, added=None, removed=None, threshold=0.5):
   153     '''find renamed files -- yields (before, after, score) tuples'''
   154     '''find renamed files -- yields (before, after, score) tuples'''
   154     if added is None or removed is None:
   155     if added is None or removed is None:
   155         added, removed = repo.status()[1:3]
   156         added, removed = repo.status()[1:3]