branch: pass current transaction when writing branch in branch command
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 02 Mar 2023 14:45:21 +0100
changeset 50261 774ed116dd7c
parent 50260 e60f9168263c
child 50262 e27a5a012323
branch: pass current transaction when writing branch in branch command
mercurial/commands.py
--- a/mercurial/commands.py	Thu Mar 02 14:44:43 2023 +0100
+++ b/mercurial/commands.py	Thu Mar 02 14:45:21 2023 +0100
@@ -1355,7 +1355,7 @@
     with repo.wlock():
         if opts.get(b'clean'):
             label = repo[b'.'].branch()
-            repo.dirstate.setbranch(label)
+            repo.dirstate.setbranch(label, repo.currenttransaction())
             ui.status(_(b'reset working directory to branch %s\n') % label)
         elif label:
 
@@ -1371,7 +1371,7 @@
                         hint=_(b"use 'hg update' to switch to it"),
                     )
 
-            repo.dirstate.setbranch(label)
+            repo.dirstate.setbranch(label, repo.currenttransaction())
             ui.status(_(b'marked working directory as branch %s\n') % label)
 
             # find any open named branches aside from default