##// END OF EJS Templates
dirstate: align the dirstatemap's API to the data change...
marmoute -
r48952:98b3eb6c default
parent child Browse files
Show More
@@ -516,12 +516,7 b' class dirstate(object):'
516 wc_tracked = False
516 wc_tracked = False
517 else:
517 else:
518 wc_tracked = entry.tracked
518 wc_tracked = entry.tracked
519 possibly_dirty = False
519 if not (p1_tracked or wc_tracked):
520 if p1_tracked and wc_tracked:
521 # the underlying reference might have changed, we will have to
522 # check it.
523 possibly_dirty = True
524 elif not (p1_tracked or wc_tracked):
525 # the file is no longer relevant to anyone
520 # the file is no longer relevant to anyone
526 if self._map.get(filename) is not None:
521 if self._map.get(filename) is not None:
527 self._map.reset_state(filename)
522 self._map.reset_state(filename)
@@ -529,10 +524,6 b' class dirstate(object):'
529 elif (not p1_tracked) and wc_tracked:
524 elif (not p1_tracked) and wc_tracked:
530 if entry is not None and entry.added:
525 if entry is not None and entry.added:
531 return # avoid dropping copy information (maybe?)
526 return # avoid dropping copy information (maybe?)
532 elif p1_tracked and not wc_tracked:
533 pass
534 else:
535 assert False, 'unreachable'
536
527
537 # this mean we are doing call for file we do not really care about the
528 # this mean we are doing call for file we do not really care about the
538 # data (eg: added or removed), however this should be a minor overhead
529 # data (eg: added or removed), however this should be a minor overhead
@@ -545,7 +536,9 b' class dirstate(object):'
545 filename,
536 filename,
546 wc_tracked,
537 wc_tracked,
547 p1_tracked,
538 p1_tracked,
548 possibly_dirty=possibly_dirty,
539 # the underlying reference might have changed, we will have to
540 # check it.
541 has_meaningful_mtime=False,
549 parentfiledata=parentfiledata,
542 parentfiledata=parentfiledata,
550 )
543 )
551 if (
544 if (
@@ -616,11 +609,8 b' class dirstate(object):'
616 filename,
609 filename,
617 wc_tracked,
610 wc_tracked,
618 p1_tracked,
611 p1_tracked,
619 p2_tracked=p2_tracked,
612 p2_info=merged or clean_p2,
620 merged=merged,
613 has_meaningful_mtime=not possibly_dirty,
621 clean_p1=clean_p1,
622 clean_p2=clean_p2,
623 possibly_dirty=possibly_dirty,
624 parentfiledata=parentfiledata,
614 parentfiledata=parentfiledata,
625 )
615 )
626 if (
616 if (
@@ -773,7 +763,6 b' class dirstate(object):'
773 f,
763 f,
774 wc_tracked=True,
764 wc_tracked=True,
775 p1_tracked=True,
765 p1_tracked=True,
776 possibly_dirty=True,
777 )
766 )
778 for f in to_drop:
767 for f in to_drop:
779 self._map.reset_state(f)
768 self._map.reset_state(f)
@@ -173,11 +173,9 b' class _dirstatemapcommon(object):'
173 filename,
173 filename,
174 wc_tracked=False,
174 wc_tracked=False,
175 p1_tracked=False,
175 p1_tracked=False,
176 p2_tracked=False,
176 p2_info=False,
177 merged=False,
177 has_meaningful_mtime=True,
178 clean_p1=False,
178 has_meaningful_data=True,
179 clean_p2=False,
180 possibly_dirty=False,
181 parentfiledata=None,
179 parentfiledata=None,
182 ):
180 ):
183 """Set a entry to a given state, diregarding all previous state
181 """Set a entry to a given state, diregarding all previous state
@@ -189,25 +187,16 b' class _dirstatemapcommon(object):'
189 dirstate map does not see any point at having one for this file
187 dirstate map does not see any point at having one for this file
190 anymore.
188 anymore.
191 """
189 """
192 if merged and (clean_p1 or clean_p2):
193 msg = b'`merged` argument incompatible with `clean_p1`/`clean_p2`'
194 raise error.ProgrammingError(msg)
195 # copy information are now outdated
190 # copy information are now outdated
196 # (maybe new information should be in directly passed to this function)
191 # (maybe new information should be in directly passed to this function)
197 self.copymap.pop(filename, None)
192 self.copymap.pop(filename, None)
198
193
199 if not (p1_tracked or p2_tracked or wc_tracked):
194 if not (p1_tracked or p2_info or wc_tracked):
200 old_entry = self._map.get(filename)
195 old_entry = self._map.get(filename)
201 self._drop_entry(filename)
196 self._drop_entry(filename)
202 self._dirs_decr(filename, old_entry=old_entry)
197 self._dirs_decr(filename, old_entry=old_entry)
203 return
198 return
204
199
205 p2_info = merged or clean_p2
206 if merged:
207 assert p1_tracked
208
209 has_meaningful_mtime = not possibly_dirty
210
211 old_entry = self._map.get(filename)
200 old_entry = self._map.get(filename)
212 self._dirs_incr(filename, old_entry)
201 self._dirs_incr(filename, old_entry)
213 entry = DirstateItem(
202 entry = DirstateItem(
General Comments 0
You need to be logged in to leave comments. Login now