Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 6583:3951e04ea989
walk: remove more old badmatch logic
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 12 May 2008 11:37:08 -0500 |
parents | 5acbdd3941c4 |
children | 29c77e5dfb3c |
comparison
equal
deleted
inserted
replaced
6582:5acbdd3941c4 | 6583:3951e04ea989 |
---|---|
1695 else: | 1695 else: |
1696 node = None | 1696 node = None |
1697 | 1697 |
1698 ret = 1 | 1698 ret = 1 |
1699 m = cmdutil.match(repo, pats, opts, default='relglob') | 1699 m = cmdutil.match(repo, pats, opts, default='relglob') |
1700 m.bad = lambda x,y: True | 1700 m.bad = lambda x,y: False |
1701 for src, abs, rel, exact in cmdutil.walk(repo, m, node): | 1701 for src, abs, rel, exact in cmdutil.walk(repo, m, node): |
1702 if src == 'b': | |
1703 continue | |
1704 if not node and abs not in repo.dirstate: | 1702 if not node and abs not in repo.dirstate: |
1705 continue | 1703 continue |
1706 if opts['fullpath']: | 1704 if opts['fullpath']: |
1707 ui.write(os.path.join(repo.root, abs), end) | 1705 ui.write(os.path.join(repo.root, abs), end) |
1708 else: | 1706 else: |
2340 try: | 2338 try: |
2341 # walk dirstate. | 2339 # walk dirstate. |
2342 files = [] | 2340 files = [] |
2343 | 2341 |
2344 m = cmdutil.match(repo, pats, opts) | 2342 m = cmdutil.match(repo, pats, opts) |
2345 def bad(f, msg): | 2343 m.bad = lambda x,y: False |
2346 if f not in mf: | |
2347 repo.ui.warn("%s: %s\n" % (m.rel(f), msg)) | |
2348 return False | |
2349 m.bad = bad | |
2350 for src, abs, rel, exact in cmdutil.walk(repo, m): | 2344 for src, abs, rel, exact in cmdutil.walk(repo, m): |
2351 names[abs] = (rel, exact) | 2345 names[abs] = (rel, exact) |
2352 | 2346 |
2353 # walk target manifest. | 2347 # walk target manifest. |
2354 | 2348 |
2355 def badfn(path, msg): | 2349 def badfn(path, msg): |
2356 if path in names: | 2350 if path in names: |
2357 return True | 2351 return False |
2358 path_ = path + '/' | 2352 path_ = path + '/' |
2359 for f in names: | 2353 for f in names: |
2360 if f.startswith(path_): | 2354 if f.startswith(path_): |
2361 return True | 2355 return False |
2356 repo.ui.warn("%s: %s\n" % (m.rel(path), msg)) | |
2362 return False | 2357 return False |
2363 | 2358 |
2364 m = cmdutil.match(repo, pats, opts) | 2359 m = cmdutil.match(repo, pats, opts) |
2365 m.bad = badfn | 2360 m.bad = badfn |
2366 for src, abs, rel, exact in cmdutil.walk(repo, m, node=node): | 2361 for src, abs, rel, exact in cmdutil.walk(repo, m, node=node): |
2367 if abs in names or src == 'b': | 2362 if abs in names: |
2368 continue | 2363 continue |
2369 names[abs] = (rel, exact) | 2364 names[abs] = (rel, exact) |
2370 | 2365 |
2371 changes = repo.status(files=files, match=names.has_key)[:4] | 2366 changes = repo.status(files=files, match=names.has_key)[:4] |
2372 modified, added, removed, deleted = map(dict.fromkeys, changes) | 2367 modified, added, removed, deleted = map(dict.fromkeys, changes) |