Mercurial > hg
comparison mercurial/dirstate.py @ 48144:6f54afb094bd
dirstate: align the dirstate's API to the lower level ones
This conclude the refactoring of this API. We can now finalize the dirstate v2
on disk format.
Differential Revision: https://phab.mercurial-scm.org/D11587
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 30 Sep 2021 16:33:12 +0200 |
parents | 42ab0bcb6ded |
children | 180e8fa345cc |
comparison
equal
deleted
inserted
replaced
48143:21542d4cb568 | 48144:6f54afb094bd |
---|---|
551 def update_file( | 551 def update_file( |
552 self, | 552 self, |
553 filename, | 553 filename, |
554 wc_tracked, | 554 wc_tracked, |
555 p1_tracked, | 555 p1_tracked, |
556 p2_tracked=False, | 556 p2_info=False, |
557 merged=False, | |
558 clean_p1=False, | |
559 clean_p2=False, | |
560 possibly_dirty=False, | 557 possibly_dirty=False, |
561 parentfiledata=None, | 558 parentfiledata=None, |
562 ): | 559 ): |
563 """update the information about a file in the dirstate | 560 """update the information about a file in the dirstate |
564 | 561 |
569 | 566 |
570 note: the API is at an early stage and we might need to adjust it | 567 note: the API is at an early stage and we might need to adjust it |
571 depending of what information ends up being relevant and useful to | 568 depending of what information ends up being relevant and useful to |
572 other processing. | 569 other processing. |
573 """ | 570 """ |
574 if merged and (clean_p1 or clean_p2): | |
575 msg = b'`merged` argument incompatible with `clean_p1`/`clean_p2`' | |
576 raise error.ProgrammingError(msg) | |
577 | 571 |
578 # note: I do not think we need to double check name clash here since we | 572 # note: I do not think we need to double check name clash here since we |
579 # are in a update/merge case that should already have taken care of | 573 # are in a update/merge case that should already have taken care of |
580 # this. The test agrees | 574 # this. The test agrees |
581 | 575 |
582 self._dirty = True | 576 self._dirty = True |
583 | 577 |
584 need_parent_file_data = ( | 578 need_parent_file_data = ( |
585 not (possibly_dirty or clean_p2 or merged) | 579 not possibly_dirty and not p2_info and wc_tracked and p1_tracked |
586 and wc_tracked | |
587 and p1_tracked | |
588 ) | 580 ) |
589 | 581 |
590 # this mean we are doing call for file we do not really care about the | 582 # this mean we are doing call for file we do not really care about the |
591 # data (eg: added or removed), however this should be a minor overhead | 583 # data (eg: added or removed), however this should be a minor overhead |
592 # compared to the overall update process calling this. | 584 # compared to the overall update process calling this. |
604 | 596 |
605 self._map.reset_state( | 597 self._map.reset_state( |
606 filename, | 598 filename, |
607 wc_tracked, | 599 wc_tracked, |
608 p1_tracked, | 600 p1_tracked, |
609 p2_info=merged or clean_p2, | 601 p2_info=p2_info, |
610 has_meaningful_mtime=not possibly_dirty, | 602 has_meaningful_mtime=not possibly_dirty, |
611 parentfiledata=parentfiledata, | 603 parentfiledata=parentfiledata, |
612 ) | 604 ) |
613 if ( | 605 if ( |
614 parentfiledata is not None | 606 parentfiledata is not None |