##// END OF EJS Templates
manifest: add matches() method...
Martin von Zweigbergk -
r23305:0cc283f4 default
parent child Browse files
Show More
@@ -71,19 +71,7 b' class basectx(object):'
71 71 object oriented way for other contexts to customize the manifest
72 72 generation.
73 73 """
74 if match.always():
75 return self.manifest().copy()
76
77 files = match.files()
78 if (match.matchfn == match.exact or
79 (not match.anypats() and util.all(fn in self for fn in files))):
80 return self.manifest().intersectfiles(files)
81
82 mf = self.manifest().copy()
83 for fn in mf.keys():
84 if not match(fn):
85 del mf[fn]
86 return mf
74 return self.manifest().matches(match)
87 75
88 76 def _matchstatus(self, other, match):
89 77 """return match.always if match is none
@@ -39,6 +39,22 b' class manifestdict(dict):'
39 39 ret._flags[fn] = flags
40 40 return ret
41 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
57
42 58 def diff(self, m2):
43 59 '''Finds changes between the current manifest and m2. The result is
44 60 returned as a dict with filename as key and values of the form
General Comments 0
You need to be logged in to leave comments. Login now