Show More
@@ -28,6 +28,7 b' class ChangingFiles(object):' | |||||
28 | Actions performed on files are gathered into 3 sets: |
|
28 | Actions performed on files are gathered into 3 sets: | |
29 |
|
29 | |||
30 | - added: files actively added in the changeset. |
|
30 | - added: files actively added in the changeset. | |
|
31 | - merged: files whose history got merged | |||
31 | - removed: files removed in the revision |
|
32 | - removed: files removed in the revision | |
32 | - touched: files affected by the merge |
|
33 | - touched: files affected by the merge | |
33 |
|
34 | |||
@@ -44,13 +45,16 b' class ChangingFiles(object):' | |||||
44 | touched=None, |
|
45 | touched=None, | |
45 | added=None, |
|
46 | added=None, | |
46 | removed=None, |
|
47 | removed=None, | |
|
48 | merged=None, | |||
47 | p1_copies=None, |
|
49 | p1_copies=None, | |
48 | p2_copies=None, |
|
50 | p2_copies=None, | |
49 | ): |
|
51 | ): | |
50 | self._added = set(() if added is None else added) |
|
52 | self._added = set(() if added is None else added) | |
|
53 | self._merged = set(() if merged is None else merged) | |||
51 | self._removed = set(() if removed is None else removed) |
|
54 | self._removed = set(() if removed is None else removed) | |
52 | self._touched = set(() if touched is None else touched) |
|
55 | self._touched = set(() if touched is None else touched) | |
53 | self._touched.update(self._added) |
|
56 | self._touched.update(self._added) | |
|
57 | self._touched.update(self._merged) | |||
54 | self._touched.update(self._removed) |
|
58 | self._touched.update(self._removed) | |
55 | self._p1_copies = dict(() if p1_copies is None else p1_copies) |
|
59 | self._p1_copies = dict(() if p1_copies is None else p1_copies) | |
56 | self._p2_copies = dict(() if p2_copies is None else p2_copies) |
|
60 | self._p2_copies = dict(() if p2_copies is None else p2_copies) | |
@@ -58,6 +62,7 b' class ChangingFiles(object):' | |||||
58 | def __eq__(self, other): |
|
62 | def __eq__(self, other): | |
59 | return ( |
|
63 | return ( | |
60 | self.added == other.added |
|
64 | self.added == other.added | |
|
65 | and self.merged == other.merged | |||
61 | and self.removed == other.removed |
|
66 | and self.removed == other.removed | |
62 | and self.touched == other.touched |
|
67 | and self.touched == other.touched | |
63 | and self.copied_from_p1 == other.copied_from_p1 |
|
68 | and self.copied_from_p1 == other.copied_from_p1 | |
@@ -86,6 +91,24 b' class ChangingFiles(object):' | |||||
86 | self.mark_added(f) |
|
91 | self.mark_added(f) | |
87 |
|
92 | |||
88 | @property |
|
93 | @property | |
|
94 | def merged(self): | |||
|
95 | """files actively merged during a merge | |||
|
96 | ||||
|
97 | Any modified files which had modification on both size that needed merging. | |||
|
98 | ||||
|
99 | In this case a new filenode was created and it has two parents. | |||
|
100 | """ | |||
|
101 | return frozenset(self._merged) | |||
|
102 | ||||
|
103 | def mark_merged(self, filename): | |||
|
104 | self._merged.add(filename) | |||
|
105 | self._touched.add(filename) | |||
|
106 | ||||
|
107 | def update_merged(self, filenames): | |||
|
108 | for f in filenames: | |||
|
109 | self.mark_merged(f) | |||
|
110 | ||||
|
111 | @property | |||
89 | def removed(self): |
|
112 | def removed(self): | |
90 | """files actively removed by the changeset |
|
113 | """files actively removed by the changeset | |
91 |
|
114 |
General Comments 0
You need to be logged in to leave comments.
Login now