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] |