mercurial/localrepo.py
changeset 4195 b5d1eaade333
parent 4177 ba51a8225a60
parent 4190 e8ee8fdeddb1
child 4209 dbc3846c09a1
equal deleted inserted replaced
4177:ba51a8225a60 4195:b5d1eaade333
   871         'b' file was not found and matched badmatch
   871         'b' file was not found and matched badmatch
   872         '''
   872         '''
   873 
   873 
   874         if node:
   874         if node:
   875             fdict = dict.fromkeys(files)
   875             fdict = dict.fromkeys(files)
   876             for fn in self.manifest.read(self.changelog.read(node)[0]):
   876             # for dirstate.walk, files=['.'] means "walk the whole tree".
       
   877             # follow that here, too
       
   878             fdict.pop('.', None)
       
   879             mdict = self.manifest.read(self.changelog.read(node)[0])
       
   880             mfiles = mdict.keys()
       
   881             mfiles.sort()
       
   882             for fn in mfiles:
   877                 for ffn in fdict:
   883                 for ffn in fdict:
   878                     # match if the file is the exact name or a directory
   884                     # match if the file is the exact name or a directory
   879                     if ffn == fn or fn.startswith("%s/" % ffn):
   885                     if ffn == fn or fn.startswith("%s/" % ffn):
   880                         del fdict[ffn]
   886                         del fdict[ffn]
   881                         break
   887                         break
   882                 if match(fn):
   888                 if match(fn):
   883                     yield 'm', fn
   889                     yield 'm', fn
   884             for fn in fdict:
   890             ffiles = fdict.keys()
       
   891             ffiles.sort()
       
   892             for fn in ffiles:
   885                 if badmatch and badmatch(fn):
   893                 if badmatch and badmatch(fn):
   886                     if match(fn):
   894                     if match(fn):
   887                         yield 'b', fn
   895                         yield 'b', fn
   888                 else:
   896                 else:
   889                     self.ui.warn(_('%s: No such file in rev %s\n') % (
   897                     self.ui.warn(_('%s: No such file in rev %s\n') % (