Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 6578:f242d3684f83
walk: begin refactoring badmatch handling
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 12 May 2008 11:37:07 -0500 |
parents | 569761919450 |
children | 3951e04ea989 |
comparison
equal
deleted
inserted
replaced
6577:569761919450 | 6578:f242d3684f83 |
---|---|
929 finally: | 929 finally: |
930 if not valid: # don't save our updated dirstate | 930 if not valid: # don't save our updated dirstate |
931 self.dirstate.invalidate() | 931 self.dirstate.invalidate() |
932 del tr, lock, wlock | 932 del tr, lock, wlock |
933 | 933 |
934 def walk(self, node, match, badmatch): | 934 def walk(self, node, match): |
935 ''' | 935 ''' |
936 walk recursively through the directory tree or a given | 936 walk recursively through the directory tree or a given |
937 changeset, finding all files matched by the match | 937 changeset, finding all files matched by the match |
938 function | 938 function |
939 | 939 |
961 if match(fn): | 961 if match(fn): |
962 yield 'm', fn | 962 yield 'm', fn |
963 ffiles = fdict.keys() | 963 ffiles = fdict.keys() |
964 ffiles.sort() | 964 ffiles.sort() |
965 for fn in ffiles: | 965 for fn in ffiles: |
966 if badmatch and badmatch(fn): | 966 if match.bad(fn, 'No such file in rev ' + short(node)) \ |
967 if match(fn): | 967 and match(fn): |
968 yield 'b', fn | 968 yield 'b', fn |
969 else: | |
970 self.ui.warn(_('%s: No such file in rev %s\n') | |
971 % (self.pathto(fn), short(node))) | |
972 else: | 969 else: |
973 for src, fn in self.dirstate.walk(match, badmatch): | 970 for src, fn in self.dirstate.walk(match): |
974 yield src, fn | 971 yield src, fn |
975 | 972 |
976 def status(self, node1=None, node2=None, files=[], match=util.always, | 973 def status(self, node1=None, node2=None, files=[], match=util.always, |
977 list_ignored=False, list_clean=False, list_unknown=True): | 974 list_ignored=False, list_clean=False, list_unknown=True): |
978 """return status of files between two nodes or node and working directory | 975 """return status of files between two nodes or node and working directory |