##// END OF EJS Templates
walk: remove more old badmatch logic
Matt Mackall -
r6583:3951e04e default
parent child Browse files
Show More
@@ -1697,10 +1697,8 b' def locate(ui, repo, *pats, **opts):'
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']:
@@ -2342,11 +2340,7 b' def revert(ui, repo, *pats, **opts):'
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
@@ -2354,17 +2348,18 b' def revert(ui, repo, *pats, **opts):'
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
@@ -432,7 +432,6 b' class dirstate(object):'
432 'f' the file was found in the directory tree
432 'f' the file was found in the directory tree
433 'd' the file is a directory of the tree
433 'd' the file is a directory of the tree
434 'm' the file was only in the dirstate and not in the tree
434 'm' the file was only in the dirstate and not in the tree
435 'b' file was not found and did not match badfn
436
435
437 and st is the stat result if the file was found in the directory.
436 and st is the stat result if the file was found in the directory.
438 '''
437 '''
@@ -543,7 +542,7 b' class dirstate(object):'
543 if inst.errno != errno.ENOENT:
542 if inst.errno != errno.ENOENT:
544 fwarn(ff, inst.strerror)
543 fwarn(ff, inst.strerror)
545 elif badfn(ff, inst.strerror) and imatch(nf):
544 elif badfn(ff, inst.strerror) and imatch(nf):
546 yield 'b', ff, None
545 yield 'f', ff, None
547 continue
546 continue
548 if s_isdir(st.st_mode):
547 if s_isdir(st.st_mode):
549 if not dirignore(nf):
548 if not dirignore(nf):
@@ -941,7 +941,6 b' class localrepository(repo.repository):'
941 is one of:
941 is one of:
942 'f' the file was found in the directory tree
942 'f' the file was found in the directory tree
943 'm' the file was only in the dirstate and not in the tree
943 'm' the file was only in the dirstate and not in the tree
944 'b' file was not found and matched badmatch
945 '''
944 '''
946
945
947 if node:
946 if node:
@@ -965,7 +964,7 b' class localrepository(repo.repository):'
965 for fn in ffiles:
964 for fn in ffiles:
966 if match.bad(fn, 'No such file in rev ' + short(node)) \
965 if match.bad(fn, 'No such file in rev ' + short(node)) \
967 and match(fn):
966 and match(fn):
968 yield 'b', fn
967 yield 'f', fn
969 else:
968 else:
970 for src, fn in self.dirstate.walk(match):
969 for src, fn in self.dirstate.walk(match):
971 yield src, fn
970 yield src, fn
@@ -37,7 +37,7 b' no changes needed to a'
37 %% should say file not managed
37 %% should say file not managed
38 file not managed: q
38 file not managed: q
39 %% should say file not found
39 %% should say file not found
40 notfound: No such file or directory
40 notfound: No such file in rev 095eacd0c0d7
41 A z
41 A z
42 ? e.orig
42 ? e.orig
43 %% should add a, remove d, forget z
43 %% should add a, remove d, forget z
General Comments 0
You need to be logged in to leave comments. Login now