##// END OF EJS Templates
manifest: add optional recording of clean entries to diff...
Augie Fackler -
r23756:829f640b default
parent child Browse files
Show More
@@ -58,13 +58,21 b' class manifestdict(dict):'
58 del mf[fn]
58 del mf[fn]
59 return mf
59 return mf
60
60
61 def diff(self, m2):
61 def diff(self, m2, clean=False):
62 '''Finds changes between the current manifest and m2. The result is
62 '''Finds changes between the current manifest and m2.
63 returned as a dict with filename as key and values of the form
63
64 ((n1,fl1),(n2,fl2)), where n1/n2 is the nodeid in the current/other
64 Args:
65 manifest and fl1/fl2 is the flag in the current/other manifest. Where
65 m2: the manifest to which this manifest should be compared.
66 the file does not exist, the nodeid will be None and the flags will be
66 clean: if true, include files unchanged between these manifests
67 the empty string.'''
67 with a None value in the returned dictionary.
68
69 The result is returned as a dict with filename as key and
70 values of the form ((n1,fl1),(n2,fl2)), where n1/n2 is the
71 nodeid in the current/other manifest and fl1/fl2 is the flag
72 in the current/other manifest. Where the file does not exist,
73 the nodeid will be None and the flags will be the empty
74 string.
75 '''
68 diff = {}
76 diff = {}
69
77
70 for fn, n1 in self.iteritems():
78 for fn, n1 in self.iteritems():
@@ -75,6 +83,8 b' class manifestdict(dict):'
75 fl2 = ''
83 fl2 = ''
76 if n1 != n2 or fl1 != fl2:
84 if n1 != n2 or fl1 != fl2:
77 diff[fn] = ((n1, fl1), (n2, fl2))
85 diff[fn] = ((n1, fl1), (n2, fl2))
86 elif clean:
87 diff[fn] = None
78
88
79 for fn, n2 in m2.iteritems():
89 for fn, n2 in m2.iteritems():
80 if fn not in self:
90 if fn not in self:
General Comments 0
You need to be logged in to leave comments. Login now