commitcloud: wrap update in transaction

Summary:
As part of moving the dirstate to require a transaction, let's wrap the
update in commitcloud.

Reviewed By: quark-zju

Differential Revision: D18213046

fbshipit-source-id: e59c880ea5e8d8808499f94c983c26e7466204e2
This commit is contained in:
Durham Goode 2020-01-14 17:45:49 -08:00 committed by Facebook Github Bot
parent b3d7defa23
commit cd3d20e4e3

View File

@ -311,9 +311,10 @@ def _maybeupdateworkingcopy(repo, currentnode):
),
)
ui.status(_("updating to %s\n") % nodemod.short(destination))
return hg.updatetotally(
ui, repo, destination, destination, updatecheck="noconflict"
)
with repo.wlock(), repo.lock(), repo.transaction("sync-checkout"):
return hg.updatetotally(
ui, repo, destination, destination, updatecheck="noconflict"
)
else:
hintutil.trigger("commitcloud-update-on-move")
else: