--- 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
)