# HG changeset patch # User Pierre-Yves David # Date 2023-03-02 13:45:39 # Node ID 798e4314ddd9ec5610f619785e0e670d30dd6394 # Parent e27a5a0123231addb3c1794d0b58f4cebe5c2cad branch: pass current transaction when writing branch in import diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2031,7 +2031,9 @@ def tryimportone(ui, repo, patchdata, pa repo.setparents(p1.node(), p2.node()) if opts.get(b'exact') or importbranch: - repo.dirstate.setbranch(branch or b'default') + repo.dirstate.setbranch( + branch or b'default', repo.currenttransaction() + ) partial = opts.get(b'partial', False) files = set()