Patchwork rebase: drop unnecessary parentchange call

login
register
mail settings
Submitter Siddharth Agarwal
Date June 1, 2017, 3:07 a.m.
Message ID <bd3d33c6014f4553c799.1496286435@devvm31800.prn1.facebook.com>
Download mbox | patch
Permalink /patch/21113/
State Accepted
Headers show

Comments

Siddharth Agarwal - June 1, 2017, 3:07 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1496285164 25200
#      Wed May 31 19:46:04 2017 -0700
# Node ID bd3d33c6014f4553c799c0d3236e17b28ffc85e3
# Parent  dc0da9829c2972e1c97e07428d6885c1cd4b8f1f
rebase: drop unnecessary parentchange call

We're calling localrepo.setparents here, not dirstate.setparents.
localrepo.setparents calls dirstate.parentchange already.
Sean Farley - June 1, 2017, 3:16 a.m.
Siddharth Agarwal <sid0@fb.com> writes:

> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1496285164 25200
> #      Wed May 31 19:46:04 2017 -0700
> # Node ID bd3d33c6014f4553c799c0d3236e17b28ffc85e3
> # Parent  dc0da9829c2972e1c97e07428d6885c1cd4b8f1f
> rebase: drop unnecessary parentchange call
>
> We're calling localrepo.setparents here, not dirstate.setparents.
> localrepo.setparents calls dirstate.parentchange already.

Makes sense, queued thanks!

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -427,8 +427,7 @@  class rebaseruntime(object):
                         mergemod.mergestate.clean(repo)
                 else:
                     # Skip commit if we are collapsing
-                    with repo.dirstate.parentchange():
-                        repo.setparents(repo[p1].node())
+                    repo.setparents(repo[p1].node())
                     newnode = None
                 # Update the state
                 if newnode is not None: