Patchwork D2919: rebase: pass in "keepbranch" to conclude[memory]node()

login
register
mail settings
Submitter phabricator
Date March 21, 2018, 11:46 p.m.
Message ID <80ca4c8489c6ddc9f0bbea00dfce9de4@localhost.localdomain>
Download mbox | patch
Permalink /patch/29737/
State Not Applicable
Headers show

Comments

phabricator - March 21, 2018, 11:46 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG7db86856f27f: rebase: pass in &quot;keepbranch&quot; to conclude[memory]node() (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2919?vs=7182&id=7211

REVISION DETAIL
  https://phab.mercurial-scm.org/D2919

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: martinvonz, phillco, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -449,21 +449,22 @@ 
         extra = {'rebase_source': ctx.hex()}
         for c in self.extrafns:
             c(ctx, extra)
+        keepbranch = self.keepbranchesf and repo[p1].branch() != ctx.branch()
         if self.inmemory:
             newnode = concludememorynode(repo, ctx, p1, p2,
                 wctx=self.wctx,
                 extra=extra,
                 commitmsg=commitmsg,
                 editor=editor,
-                keepbranches=self.keepbranchesf,
+                keepbranch=keepbranch,
                 date=self.date)
             mergemod.mergestate.clean(repo)
         else:
             newnode = concludenode(repo, ctx, p1, p2,
                 extra=extra,
                 commitmsg=commitmsg,
                 editor=editor,
-                keepbranches=self.keepbranchesf,
+                keepbranch=keepbranch,
                 date=self.date)
 
         if newnode is None:
@@ -1023,13 +1024,11 @@ 
                      (max(destancestors),
                       ', '.join("%d" % p for p in sorted(parents))))
 
-def concludememorynode(repo, ctx, p1, p2, wctx, editor, extra, keepbranches,
+def concludememorynode(repo, ctx, p1, p2, wctx, editor, extra, keepbranch,
                        date, commitmsg):
     '''Commit the memory changes with parents p1 and p2. Reuse commit info from
     ctx.
     Return node of committed revision.'''
-    keepbranch = keepbranches and repo[p1].branch() != ctx.branch()
-
     destphase = max(ctx.phase(), phases.draft)
     overrides = {('phases', 'new-commit'): destphase}
     if keepbranch:
@@ -1054,16 +1053,15 @@ 
         wctx.clean() # Might be reused
         return commitres
 
-def concludenode(repo, ctx, p1, p2, editor, extra, keepbranches, date,
+def concludenode(repo, ctx, p1, p2, editor, extra, keepbranch, date,
                  commitmsg):
     '''Commit the wd changes with parents p1 and p2. Reuse commit info from ctx.
     Return node of committed revision.'''
     dsguard = util.nullcontextmanager()
     if not repo.ui.configbool('rebase', 'singletransaction'):
         dsguard = dirstateguard.dirstateguard(repo, 'rebase')
     with dsguard:
         repo.setparents(repo[p1].node(), repo[p2].node())
-        keepbranch = keepbranches and repo[p1].branch() != ctx.branch()
 
         destphase = max(ctx.phase(), phases.draft)
         overrides = {('phases', 'new-commit'): destphase}