Show More
@@ -235,10 +235,6 b' def match(repo, pats=[], opts={}, globbe' | |||
|
235 | 235 | m.bad = badfn |
|
236 | 236 | return m |
|
237 | 237 | |
|
238 | def walk(repo, match, node=None): | |
|
239 | for src, fn in repo.walk(node, match): | |
|
240 | yield src, fn | |
|
241 | ||
|
242 | 238 | def findrenames(repo, added=None, removed=None, threshold=0.5): |
|
243 | 239 | '''find renamed files -- yields (before, after, score) tuples''' |
|
244 | 240 | if added is None or removed is None: |
@@ -275,7 +271,7 b' def addremove(repo, pats=[], opts={}, dr' | |||
|
275 | 271 | add, remove = [], [] |
|
276 | 272 | mapping = {} |
|
277 | 273 | m = match(repo, pats, opts) |
|
278 |
for src, abs in walk( |
|
|
274 | for src, abs in repo.walk(m): | |
|
279 | 275 | target = repo.wjoin(abs) |
|
280 | 276 | rel = m.rel(abs) |
|
281 | 277 | exact = m.exact(abs) |
@@ -317,7 +313,7 b' def copy(ui, repo, pats, opts, rename=Fa' | |||
|
317 | 313 | def walkpat(pat): |
|
318 | 314 | srcs = [] |
|
319 | 315 | m = match(repo, [pat], opts, globbed=True) |
|
320 |
for tag, abs in walk( |
|
|
316 | for tag, abs in repo.walk(m): | |
|
321 | 317 | state = repo.dirstate[abs] |
|
322 | 318 | rel = m.rel(abs) |
|
323 | 319 | exact = m.exact(abs) |
@@ -33,7 +33,7 b' def add(ui, repo, *pats, **opts):' | |||
|
33 | 33 | names = [] |
|
34 | 34 | m = cmdutil.match(repo, pats, opts) |
|
35 | 35 | m.bad = lambda x,y: True |
|
36 |
for src, abs in |
|
|
36 | for src, abs in repo.walk(m): | |
|
37 | 37 | if m.exact(abs): |
|
38 | 38 | if ui.verbose: |
|
39 | 39 | ui.status(_('adding %s\n') % m.rel(abs)) |
@@ -110,7 +110,7 b' def annotate(ui, repo, *pats, **opts):' | |||
|
110 | 110 | ctx = repo.changectx(opts['rev']) |
|
111 | 111 | |
|
112 | 112 | m = cmdutil.match(repo, pats, opts) |
|
113 |
for src, abs in |
|
|
113 | for src, abs in repo.walk(m, ctx.node()): | |
|
114 | 114 | fctx = ctx.filectx(abs) |
|
115 | 115 | if not opts['text'] and util.binary(fctx.data()): |
|
116 | 116 | ui.write(_("%s: binary file\n") % ((pats and m.rel(abs)) or abs)) |
@@ -489,7 +489,7 b' def cat(ui, repo, file1, *pats, **opts):' | |||
|
489 | 489 | ctx = repo.changectx(opts['rev']) |
|
490 | 490 | err = 1 |
|
491 | 491 | m = cmdutil.match(repo, (file1,) + pats, opts) |
|
492 |
for src, abs in |
|
|
492 | for src, abs in repo.walk(m, ctx.node()): | |
|
493 | 493 | fp = cmdutil.make_file(repo, opts['output'], ctx.node(), pathname=abs) |
|
494 | 494 | data = ctx.filectx(abs).data() |
|
495 | 495 | if opts.get('decode'): |
@@ -915,7 +915,7 b' def debugrename(ui, repo, file1, *pats, ' | |||
|
915 | 915 | |
|
916 | 916 | ctx = repo.changectx(opts.get('rev', 'tip')) |
|
917 | 917 | m = cmdutil.match(repo, (file1,) + pats, opts) |
|
918 |
for src, abs in |
|
|
918 | for src, abs in repo.walk(m, ctx.node()): | |
|
919 | 919 | fctx = ctx.filectx(abs) |
|
920 | 920 | o = fctx.filelog().renamed(fctx.filenode()) |
|
921 | 921 | rel = m.rel(abs) |
@@ -927,7 +927,7 b' def debugrename(ui, repo, file1, *pats, ' | |||
|
927 | 927 | def debugwalk(ui, repo, *pats, **opts): |
|
928 | 928 | """show how files match on given patterns""" |
|
929 | 929 | m = cmdutil.match(repo, pats, opts) |
|
930 |
items = list( |
|
|
930 | items = list(repo.walk(m)) | |
|
931 | 931 | if not items: |
|
932 | 932 | return |
|
933 | 933 | fmt = '%%s %%-%ds %%-%ds %%s' % ( |
@@ -1699,7 +1699,7 b' def locate(ui, repo, *pats, **opts):' | |||
|
1699 | 1699 | ret = 1 |
|
1700 | 1700 | m = cmdutil.match(repo, pats, opts, default='relglob') |
|
1701 | 1701 | m.bad = lambda x,y: False |
|
1702 |
for src, abs in |
|
|
1702 | for src, abs in repo.walk(m, node): | |
|
1703 | 1703 | if not node and abs not in repo.dirstate: |
|
1704 | 1704 | continue |
|
1705 | 1705 | if opts['fullpath']: |
@@ -2185,7 +2185,7 b' def remove(ui, repo, *pats, **opts):' | |||
|
2185 | 2185 | modified, added, removed, deleted, unknown = mardu |
|
2186 | 2186 | |
|
2187 | 2187 | remove, forget = [], [] |
|
2188 |
for src, abs in |
|
|
2188 | for src, abs in repo.walk(m): | |
|
2189 | 2189 | |
|
2190 | 2190 | reason = None |
|
2191 | 2191 | if abs in removed or abs in unknown: |
@@ -2342,7 +2342,7 b' def revert(ui, repo, *pats, **opts):' | |||
|
2342 | 2342 | |
|
2343 | 2343 | m = cmdutil.match(repo, pats, opts) |
|
2344 | 2344 | m.bad = lambda x,y: False |
|
2345 |
for src, abs in |
|
|
2345 | for src, abs in repo.walk(m): | |
|
2346 | 2346 | names[abs] = m.rel(abs), m.exact(abs) |
|
2347 | 2347 | |
|
2348 | 2348 | # walk target manifest. |
@@ -2359,7 +2359,7 b' def revert(ui, repo, *pats, **opts):' | |||
|
2359 | 2359 | |
|
2360 | 2360 | m = cmdutil.match(repo, pats, opts) |
|
2361 | 2361 | m.bad = badfn |
|
2362 |
for src, abs in |
|
|
2362 | for src, abs in repo.walk(m, node=node): | |
|
2363 | 2363 | if abs not in names: |
|
2364 | 2364 | names[abs] = m.rel(abs), m.exact(abs) |
|
2365 | 2365 |
@@ -931,7 +931,7 b' class localrepository(repo.repository):' | |||
|
931 | 931 | self.dirstate.invalidate() |
|
932 | 932 | del tr, lock, wlock |
|
933 | 933 | |
|
934 |
def walk(self, |
|
|
934 | def walk(self, match, node=None): | |
|
935 | 935 | ''' |
|
936 | 936 | walk recursively through the directory tree or a given |
|
937 | 937 | changeset, finding all files matched by the match |
General Comments 0
You need to be logged in to leave comments.
Login now