562 other processing. |
562 other processing. |
563 """ |
563 """ |
564 if merged and (clean_p1 or clean_p2): |
564 if merged and (clean_p1 or clean_p2): |
565 msg = b'`merged` argument incompatible with `clean_p1`/`clean_p2`' |
565 msg = b'`merged` argument incompatible with `clean_p1`/`clean_p2`' |
566 raise error.ProgrammingError(msg) |
566 raise error.ProgrammingError(msg) |
567 if not (p1_tracked or p2_tracked or wc_tracked): |
567 |
568 self._drop(filename) |
568 # note: I do not think we need to double check name clash here since we |
569 elif merged: |
569 # are in a update/merge case that should already have taken care of |
570 assert wc_tracked |
570 # this. The test agrees |
571 assert self.in_merge # we are never in the "normallookup" case |
571 |
572 self.otherparent(filename) |
572 self._dirty = True |
573 elif not (p1_tracked or p2_tracked) and wc_tracked: |
573 self._updatedfiles.add(filename) |
574 self._addpath(filename, added=True, possibly_dirty=possibly_dirty) |
574 |
575 self._map.copymap.pop(filename, None) |
575 need_parent_file_data = ( |
576 elif (p1_tracked or p2_tracked) and not wc_tracked: |
576 not (possibly_dirty or clean_p2 or merged) |
577 self._remove(filename) |
577 and wc_tracked |
578 elif clean_p2 and wc_tracked: |
578 and p1_tracked |
579 assert p2_tracked |
579 ) |
580 self.otherparent(filename) |
580 |
581 elif not p1_tracked and p2_tracked and wc_tracked: |
581 # this mean we are doing call for file we do not really care about the |
582 self._addpath(filename, from_p2=True, possibly_dirty=possibly_dirty) |
582 # data (eg: added or removed), however this should be a minor overhead |
583 self._map.copymap.pop(filename, None) |
583 # compared to the overall update process calling this. |
584 elif possibly_dirty: |
584 if need_parent_file_data: |
585 self._addpath(filename, possibly_dirty=possibly_dirty) |
585 if parentfiledata is None: |
586 elif wc_tracked: |
586 parentfiledata = self._get_filedata(filename) |
587 self.normal(filename, parentfiledata=parentfiledata) |
587 mtime = parentfiledata[2] |
588 # XXX We need something for file that are dirty after an update |
588 |
589 else: |
589 if mtime > self._lastnormaltime: |
590 assert False, 'unreachable' |
590 # Remember the most recent modification timeslot for |
|
591 # status(), to make sure we won't miss future |
|
592 # size-preserving file content modifications that happen |
|
593 # within the same timeslot. |
|
594 self._lastnormaltime = mtime |
|
595 |
|
596 self._map.reset_state( |
|
597 filename, |
|
598 wc_tracked, |
|
599 p1_tracked, |
|
600 p2_tracked=p2_tracked, |
|
601 merged=merged, |
|
602 clean_p1=clean_p1, |
|
603 clean_p2=clean_p2, |
|
604 possibly_dirty=possibly_dirty, |
|
605 parentfiledata=parentfiledata, |
|
606 ) |
591 |
607 |
592 def _addpath( |
608 def _addpath( |
593 self, |
609 self, |
594 f, |
610 f, |
595 mode=0, |
611 mode=0, |