Show More
@@ -31,6 +31,7 b' class ChangingFiles(object):' | |||||
31 | - added: files actively added in the changeset. |
|
31 | - added: files actively added in the changeset. | |
32 | - merged: files whose history got merged |
|
32 | - merged: files whose history got merged | |
33 | - removed: files removed in the revision |
|
33 | - removed: files removed in the revision | |
|
34 | - salvaged: files that might have been deleted by a merge but were not | |||
34 | - touched: files affected by the merge |
|
35 | - touched: files affected by the merge | |
35 |
|
36 | |||
36 | and copies information is held by 2 mappings |
|
37 | and copies information is held by 2 mappings | |
@@ -47,6 +48,7 b' class ChangingFiles(object):' | |||||
47 | added=None, |
|
48 | added=None, | |
48 | removed=None, |
|
49 | removed=None, | |
49 | merged=None, |
|
50 | merged=None, | |
|
51 | salvaged=None, | |||
50 | p1_copies=None, |
|
52 | p1_copies=None, | |
51 | p2_copies=None, |
|
53 | p2_copies=None, | |
52 | ): |
|
54 | ): | |
@@ -54,6 +56,7 b' class ChangingFiles(object):' | |||||
54 | self._merged = set(() if merged is None else merged) |
|
56 | self._merged = set(() if merged is None else merged) | |
55 | self._removed = set(() if removed is None else removed) |
|
57 | self._removed = set(() if removed is None else removed) | |
56 | self._touched = set(() if touched is None else touched) |
|
58 | self._touched = set(() if touched is None else touched) | |
|
59 | self._salvaged = set(() if salvaged is None else salvaged) | |||
57 | self._touched.update(self._added) |
|
60 | self._touched.update(self._added) | |
58 | self._touched.update(self._merged) |
|
61 | self._touched.update(self._merged) | |
59 | self._touched.update(self._removed) |
|
62 | self._touched.update(self._removed) | |
@@ -65,6 +68,7 b' class ChangingFiles(object):' | |||||
65 | self.added == other.added |
|
68 | self.added == other.added | |
66 | and self.merged == other.merged |
|
69 | and self.merged == other.merged | |
67 | and self.removed == other.removed |
|
70 | and self.removed == other.removed | |
|
71 | and self.salvaged == other.salvaged | |||
68 | and self.touched == other.touched |
|
72 | and self.touched == other.touched | |
69 | and self.copied_from_p1 == other.copied_from_p1 |
|
73 | and self.copied_from_p1 == other.copied_from_p1 | |
70 | and self.copied_from_p2 == other.copied_from_p2 |
|
74 | and self.copied_from_p2 == other.copied_from_p2 | |
@@ -160,6 +164,26 b' class ChangingFiles(object):' | |||||
160 | self.mark_removed(f) |
|
164 | self.mark_removed(f) | |
161 |
|
165 | |||
162 | @util.propertycache |
|
166 | @util.propertycache | |
|
167 | def salvaged(self): | |||
|
168 | """files that might have been deleted by a merge, but still exists. | |||
|
169 | ||||
|
170 | During a merge, the manifest merging might select some files for | |||
|
171 | removal, or for a removed/changed conflict. If at commit time the file | |||
|
172 | still exists, its removal was "reverted" and the file is "salvaged" | |||
|
173 | """ | |||
|
174 | return frozenset(self._salvaged) | |||
|
175 | ||||
|
176 | def mark_salvaged(self, filename): | |||
|
177 | if "salvaged" in vars(self): | |||
|
178 | del self.salvaged | |||
|
179 | self._salvaged.add(filename) | |||
|
180 | self.mark_touched(filename) | |||
|
181 | ||||
|
182 | def update_salvaged(self, filenames): | |||
|
183 | for f in filenames: | |||
|
184 | self.mark_salvaged(f) | |||
|
185 | ||||
|
186 | @util.propertycache | |||
163 | def touched(self): |
|
187 | def touched(self): | |
164 | """files either actively modified, added or removed""" |
|
188 | """files either actively modified, added or removed""" | |
165 | return frozenset(self._touched) |
|
189 | return frozenset(self._touched) |
General Comments 0
You need to be logged in to leave comments.
Login now