# HG changeset patch # User Pierre-Yves David # Date 1677764811 -3600 # Node ID 921f4834b7b5db12dd7dcea75d5e70b73a37edc3 # Parent 798e4314ddd9ec5610f619785e0e670d30dd6394 branch: pass current transaction when writing branch in shelve diff -r 798e4314ddd9 -r 921f4834b7b5 mercurial/shelve.py --- a/mercurial/shelve.py Thu Mar 02 14:45:39 2023 +0100 +++ b/mercurial/shelve.py Thu Mar 02 14:46:51 2023 +0100 @@ -453,7 +453,7 @@ # transaction to do so. assert repo.currenttransaction() is None repo.dirstate.write(None) - ds.setbranch(current_branch) + ds.setbranch(current_branch, None) def getshelvename(repo, parent, opts): @@ -631,7 +631,9 @@ if _iswctxonnewbranch(repo) and not _isbareshelve(pats, opts): # In non-bare shelve we don't store newly created branch # at bundled commit - repo.dirstate.setbranch(repo[b'.'].branch()) + repo.dirstate.setbranch( + repo[b'.'].branch(), repo.currenttransaction() + ) commitfunc = getcommitfunc(extra, interactive, editor=True) if not interactive: @@ -665,7 +667,7 @@ ms.reset() if origbranch != repo[b'.'].branch() and not _isbareshelve(pats, opts): - repo.dirstate.setbranch(origbranch) + repo.dirstate.setbranch(origbranch, repo.currenttransaction()) _finishshelve(repo, tr) finally: @@ -849,7 +851,7 @@ def restorebranch(ui, repo, branchtorestore): if branchtorestore and branchtorestore != repo.dirstate.branch(): - repo.dirstate.setbranch(branchtorestore) + repo.dirstate.setbranch(branchtorestore, repo.currenttransaction()) ui.status( _(b'marked working directory as branch %s\n') % branchtorestore )