comparison mercurial/debugcommands.py @ 50000:1f28172cfce9

debugrebuilddirstate: double check that no transaction is open Since transaction impact dirstate write, we make sure nobody is trying anything strange with this internal command.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 14 Feb 2023 22:27:24 +0100
parents 637d46c5b1fa
children dae8dda6f582
comparison
equal deleted inserted replaced
49999:637d46c5b1fa 50000:1f28172cfce9
3126 One use of this command is to make the next :hg:`status` invocation 3126 One use of this command is to make the next :hg:`status` invocation
3127 check the actual file content. 3127 check the actual file content.
3128 """ 3128 """
3129 ctx = scmutil.revsingle(repo, rev) 3129 ctx = scmutil.revsingle(repo, rev)
3130 with repo.wlock(): 3130 with repo.wlock():
3131 if repo.currenttransaction() is not None:
3132 msg = b'rebuild the dirstate outside of a transaction'
3133 raise error.ProgrammingError(msg)
3131 dirstate = repo.dirstate 3134 dirstate = repo.dirstate
3132 changedfiles = None 3135 changedfiles = None
3133 # See command doc for what minimal does. 3136 # See command doc for what minimal does.
3134 if opts.get('minimal'): 3137 if opts.get('minimal'):
3135 manifestfiles = set(ctx.manifest().keys()) 3138 manifestfiles = set(ctx.manifest().keys())