mercurial/manifest.py
changeset 23305 0cc283f44655
parent 22966 ff93aa006e6a
child 23602 a4679a74df14
equal deleted inserted replaced
23304:dd3f857598a0 23305:0cc283f44655
    36                 ret[fn] = self[fn]
    36                 ret[fn] = self[fn]
    37                 flags = self._flags.get(fn, None)
    37                 flags = self._flags.get(fn, None)
    38                 if flags:
    38                 if flags:
    39                     ret._flags[fn] = flags
    39                     ret._flags[fn] = flags
    40         return ret
    40         return ret
       
    41 
       
    42     def matches(self, match):
       
    43         '''generate a new manifest filtered by the match argument'''
       
    44         if match.always():
       
    45             return self.copy()
       
    46 
       
    47         files = match.files()
       
    48         if (match.matchfn == match.exact or
       
    49             (not match.anypats() and util.all(fn in self for fn in files))):
       
    50             return self.intersectfiles(files)
       
    51 
       
    52         mf = self.copy()
       
    53         for fn in mf.keys():
       
    54             if not match(fn):
       
    55                 del mf[fn]
       
    56         return mf
    41 
    57 
    42     def diff(self, m2):
    58     def diff(self, m2):
    43         '''Finds changes between the current manifest and m2. The result is
    59         '''Finds changes between the current manifest and m2. The result is
    44         returned as a dict with filename as key and values of the form
    60         returned as a dict with filename as key and values of the form
    45         ((n1,fl1),(n2,fl2)), where n1/n2 is the nodeid in the current/other
    61         ((n1,fl1),(n2,fl2)), where n1/n2 is the nodeid in the current/other