Show More
@@ -71,19 +71,7 b' class basectx(object):' | |||||
71 | object oriented way for other contexts to customize the manifest |
|
71 | object oriented way for other contexts to customize the manifest | |
72 | generation. |
|
72 | generation. | |
73 | """ |
|
73 | """ | |
74 | if match.always(): |
|
74 | return self.manifest().matches(match) | |
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 |
|
|||
87 |
|
75 | |||
88 | def _matchstatus(self, other, match): |
|
76 | def _matchstatus(self, other, match): | |
89 | """return match.always if match is none |
|
77 | """return match.always if match is none |
@@ -39,6 +39,22 b' class manifestdict(dict):' | |||||
39 | ret._flags[fn] = flags |
|
39 | ret._flags[fn] = flags | |
40 | return ret |
|
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 | 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 |
General Comments 0
You need to be logged in to leave comments.
Login now