comparison mercurial/cmdutil.py @ 47730:cc438f793b98

record: use `update_file` instead of `normallookup` We are cheating a bit to enforce we are in a pending change context. This will have to be cleaned up later. The end goal is reached, we are now using the newer, more semantic API. Differential Revision: https://phab.mercurial-scm.org/D11172
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 19 Jul 2021 01:17:56 +0200
parents 4d1ae9cba551
children dc610e325302
comparison
equal deleted inserted replaced
47729:b66ae4468c9a 47730:cc438f793b98
628 628
629 if dirstate[realname] == b'n': 629 if dirstate[realname] == b'n':
630 # without normallookup, restoring timestamp 630 # without normallookup, restoring timestamp
631 # may cause partially committed files 631 # may cause partially committed files
632 # to be treated as unmodified 632 # to be treated as unmodified
633 dirstate.normallookup(realname) 633
634 # XXX-PENDINGCHANGE: We should clarify the context in
635 # which this function is called to make sure it
636 # already called within a `pendingchange`, However we
637 # are taking a shortcut here in order to be able to
638 # quickly deprecated the older API.
639 with dirstate.parentchange():
640 dirstate.update_file(
641 realname,
642 p1_tracked=True,
643 wc_tracked=True,
644 possibly_dirty=True,
645 )
634 646
635 # copystat=True here and above are a hack to trick any 647 # copystat=True here and above are a hack to trick any
636 # editors that have f open that we haven't modified them. 648 # editors that have f open that we haven't modified them.
637 # 649 #
638 # Also note that this racy as an editor could notice the 650 # Also note that this racy as an editor could notice the