Show More
@@ -58,13 +58,21 b' class manifestdict(dict):' | |||
|
58 | 58 | del mf[fn] |
|
59 | 59 | return mf |
|
60 | 60 | |
|
61 | def diff(self, m2): | |
|
62 |
'''Finds changes between the current manifest and m2. |
|
|
63 | returned as a dict with filename as key and values of the form | |
|
64 | ((n1,fl1),(n2,fl2)), where n1/n2 is the nodeid in the current/other | |
|
65 | manifest and fl1/fl2 is the flag in the current/other manifest. Where | |
|
66 | the file does not exist, the nodeid will be None and the flags will be | |
|
67 | the empty string.''' | |
|
61 | def diff(self, m2, clean=False): | |
|
62 | '''Finds changes between the current manifest and m2. | |
|
63 | ||
|
64 | Args: | |
|
65 | m2: the manifest to which this manifest should be compared. | |
|
66 | clean: if true, include files unchanged between these manifests | |
|
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 | 76 | diff = {} |
|
69 | 77 | |
|
70 | 78 | for fn, n1 in self.iteritems(): |
@@ -75,6 +83,8 b' class manifestdict(dict):' | |||
|
75 | 83 | fl2 = '' |
|
76 | 84 | if n1 != n2 or fl1 != fl2: |
|
77 | 85 | diff[fn] = ((n1, fl1), (n2, fl2)) |
|
86 | elif clean: | |
|
87 | diff[fn] = None | |
|
78 | 88 | |
|
79 | 89 | for fn, n2 in m2.iteritems(): |
|
80 | 90 | if fn not in self: |
General Comments 0
You need to be logged in to leave comments.
Login now