Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.1 on 2022-01-26 at 16:00 UTC+1 (a few minutes of down time)

Commit 848a323e authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

rebase: remove some redundant setting of dirstate parents

Since we're now setting the dirstate parents to its correct values
from the beginning (right after `merge.update()`), we usually don't
need to set them again before committing. The only case we need to
care about is when committing collapsed commits. So we can remove the
`setparents()` calls just before committing and add one only for the
collapse case.

Differential Revision:
parent 9c9cfecd4600
......@@ -697,6 +697,7 @@ class rebaseruntime(object):
editor = cmdutil.getcommiteditor(edit=editopt, editform=editform)
revtoreuse = max(self.state)
self.wctx.setparents(repo[p1].node(), repo[self.external].node())
newnode = self._concludenode(
revtoreuse, p1, self.external, editor, commitmsg=commitmsg
......@@ -1433,7 +1434,6 @@ def commitmemorynode(repo, p1, p2, wctx, editor, extra, user, date, commitmsg):
if b'branch' in extra:
branch = extra[b'branch']
wctx.setparents(repo[p1].node(), repo[p2].node())
memctx = wctx.tomemctx(
......@@ -1454,8 +1454,6 @@ def commitnode(repo, p1, p2, editor, extra, user, date, commitmsg):
if not repo.ui.configbool(b'rebase', b'singletransaction'):
dsguard = dirstateguard.dirstateguard(repo, b'rebase')
with dsguard:
repo.setparents(repo[p1].node(), repo[p2].node())
# Commit might fail if unresolved files exist
newnode = repo.commit(
text=commitmsg, user=user, date=date, extra=extra, editor=editor
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment