Show More
@@ -109,6 +109,37 b' class _dirstatemapcommon(object):' | |||
|
109 | 109 | |
|
110 | 110 | ### method to manipulate the entries |
|
111 | 111 | |
|
112 | def set_tracked(self, filename): | |
|
113 | new = False | |
|
114 | entry = self.get(filename) | |
|
115 | if entry is None: | |
|
116 | self._dirs_incr(filename) | |
|
117 | entry = DirstateItem( | |
|
118 | p1_tracked=False, | |
|
119 | p2_tracked=False, | |
|
120 | wc_tracked=True, | |
|
121 | merged=False, | |
|
122 | clean_p1=False, | |
|
123 | clean_p2=False, | |
|
124 | possibly_dirty=False, | |
|
125 | parentfiledata=None, | |
|
126 | ) | |
|
127 | ||
|
128 | self._insert_entry(filename, entry) | |
|
129 | new = True | |
|
130 | elif not entry.tracked: | |
|
131 | self._dirs_incr(filename, entry) | |
|
132 | entry.set_tracked() | |
|
133 | self._refresh_entry(filename, entry) | |
|
134 | new = True | |
|
135 | else: | |
|
136 | # XXX This is probably overkill for more case, but we need this to | |
|
137 | # fully replace the `normallookup` call with `set_tracked` one. | |
|
138 | # Consider smoothing this in the future. | |
|
139 | entry.set_possibly_dirty() | |
|
140 | self._refresh_entry(filename, entry) | |
|
141 | return new | |
|
142 | ||
|
112 | 143 | def set_untracked(self, f): |
|
113 | 144 | """Mark a file as no longer tracked in the dirstate map""" |
|
114 | 145 | entry = self.get(f) |
@@ -492,34 +523,6 b' class dirstatemap(_dirstatemapcommon):' | |||
|
492 | 523 | ) |
|
493 | 524 | self._map[filename] = entry |
|
494 | 525 | |
|
495 | def set_tracked(self, filename): | |
|
496 | new = False | |
|
497 | entry = self.get(filename) | |
|
498 | if entry is None: | |
|
499 | self._dirs_incr(filename) | |
|
500 | entry = DirstateItem( | |
|
501 | p1_tracked=False, | |
|
502 | p2_tracked=False, | |
|
503 | wc_tracked=True, | |
|
504 | merged=False, | |
|
505 | clean_p1=False, | |
|
506 | clean_p2=False, | |
|
507 | possibly_dirty=False, | |
|
508 | parentfiledata=None, | |
|
509 | ) | |
|
510 | self._map[filename] = entry | |
|
511 | new = True | |
|
512 | elif not entry.tracked: | |
|
513 | self._dirs_incr(filename, entry) | |
|
514 | entry.set_tracked() | |
|
515 | new = True | |
|
516 | else: | |
|
517 | # XXX This is probably overkill for more case, but we need this to | |
|
518 | # fully replace the `normallookup` call with `set_tracked` one. | |
|
519 | # Consider smoothing this in the future. | |
|
520 | self.set_possibly_dirty(filename) | |
|
521 | return new | |
|
522 | ||
|
523 | 526 | |
|
524 | 527 | if rustmod is not None: |
|
525 | 528 | |
@@ -894,23 +897,6 b' if rustmod is not None:' | |||
|
894 | 897 | else: |
|
895 | 898 | assert False, 'unreachable' |
|
896 | 899 | |
|
897 | def set_tracked(self, filename): | |
|
898 | new = False | |
|
899 | entry = self.get(filename) | |
|
900 | if entry is None: | |
|
901 | self.addfile(filename, added=True) | |
|
902 | new = True | |
|
903 | elif not entry.tracked: | |
|
904 | entry.set_tracked() | |
|
905 | self._map.set_dirstate_item(filename, entry) | |
|
906 | new = True | |
|
907 | else: | |
|
908 | # XXX This is probably overkill for more case, but we need this to | |
|
909 | # fully replace the `normallookup` call with `set_tracked` one. | |
|
910 | # Consider smoothing this in the future. | |
|
911 | self.set_possibly_dirty(filename) | |
|
912 | return new | |
|
913 | ||
|
914 | 900 | ### Legacy method we need to get rid of |
|
915 | 901 | |
|
916 | 902 | def addfile( |
General Comments 0
You need to be logged in to leave comments.
Login now