Mercurial > hg-stable
changeset 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 |
files | mercurial/commands.py mercurial/dirstate.py mercurial/localrepo.py tests/test-revert.out |
diffstat | 4 files changed, 9 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- 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)
--- 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):
--- 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
--- 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