# HG changeset patch # User Matt Mackall # Date 1210610228 18000 # Node ID 3951e04ea989db9251055323fdb81d4a56e56aa9 # Parent 5acbdd3941c404ad431eb5c245192efd38f1dadd walk: remove more old badmatch logic diff -r 5acbdd3941c4 -r 3951e04ea989 mercurial/commands.py --- a/mercurial/commands.py Mon May 12 11:37:07 2008 -0500 +++ b/mercurial/commands.py Mon May 12 11:37:08 2008 -0500 @@ -1697,10 +1697,8 @@ ret = 1 m = cmdutil.match(repo, pats, opts, default='relglob') - m.bad = lambda x,y: True + m.bad = lambda x,y: False for src, abs, rel, exact in cmdutil.walk(repo, m, node): - if src == 'b': - continue if not node and abs not in repo.dirstate: continue if opts['fullpath']: @@ -2342,11 +2340,7 @@ files = [] m = cmdutil.match(repo, pats, opts) - def bad(f, msg): - if f not in mf: - repo.ui.warn("%s: %s\n" % (m.rel(f), msg)) - return False - m.bad = bad + m.bad = lambda x,y: False for src, abs, rel, exact in cmdutil.walk(repo, m): names[abs] = (rel, exact) @@ -2354,17 +2348,18 @@ def badfn(path, msg): if path in names: - return True + return False path_ = path + '/' for f in names: if f.startswith(path_): - return True + return False + repo.ui.warn("%s: %s\n" % (m.rel(path), msg)) return False m = cmdutil.match(repo, pats, opts) m.bad = badfn for src, abs, rel, exact in cmdutil.walk(repo, m, node=node): - if abs in names or src == 'b': + if abs in names: continue names[abs] = (rel, exact) diff -r 5acbdd3941c4 -r 3951e04ea989 mercurial/dirstate.py --- a/mercurial/dirstate.py Mon May 12 11:37:07 2008 -0500 +++ b/mercurial/dirstate.py Mon May 12 11:37:08 2008 -0500 @@ -432,7 +432,6 @@ 'f' the file was found in the directory tree 'd' the file is a directory of the tree 'm' the file was only in the dirstate and not in the tree - 'b' file was not found and did not match badfn and st is the stat result if the file was found in the directory. ''' @@ -543,7 +542,7 @@ if inst.errno != errno.ENOENT: fwarn(ff, inst.strerror) elif badfn(ff, inst.strerror) and imatch(nf): - yield 'b', ff, None + yield 'f', ff, None continue if s_isdir(st.st_mode): if not dirignore(nf): diff -r 5acbdd3941c4 -r 3951e04ea989 mercurial/localrepo.py --- a/mercurial/localrepo.py Mon May 12 11:37:07 2008 -0500 +++ b/mercurial/localrepo.py Mon May 12 11:37:08 2008 -0500 @@ -941,7 +941,6 @@ is one of: 'f' the file was found in the directory tree 'm' the file was only in the dirstate and not in the tree - 'b' file was not found and matched badmatch ''' if node: @@ -965,7 +964,7 @@ for fn in ffiles: if match.bad(fn, 'No such file in rev ' + short(node)) \ and match(fn): - yield 'b', fn + yield 'f', fn else: for src, fn in self.dirstate.walk(match): yield src, fn diff -r 5acbdd3941c4 -r 3951e04ea989 tests/test-revert.out --- a/tests/test-revert.out Mon May 12 11:37:07 2008 -0500 +++ b/tests/test-revert.out Mon May 12 11:37:08 2008 -0500 @@ -37,7 +37,7 @@ %% should say file not managed file not managed: q %% should say file not found -notfound: No such file or directory +notfound: No such file in rev 095eacd0c0d7 A z ? e.orig %% should add a, remove d, forget z