Patchwork D7821: overlayworkingctx: default branch to base context's branch

login
register
mail settings
Submitter phabricator
Date Jan. 13, 2020, 2:19 p.m.
Message ID <07a500106b80986ee0c2ca21a0eab25a@localhost.localdomain>
Download mbox | patch
Permalink /patch/44267/
State Not Applicable
Headers show

Comments

phabricator - Jan. 13, 2020, 2:19 p.m.
Closed by commit rHG2ecbc4ec87d8: overlayworkingctx: default branch to base context&#039;s branch (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7821?vs=19141&id=19161

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7821/new/

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

AFFECTED FILES
  hgext/rebase.py
  mercurial/context.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -2445,6 +2445,9 @@ 
                 # necessary for memctx to register a deletion.
                 return None
 
+        if branch is None:
+            branch = self._wrappedctx.branch()
+
         return memctx(
             self._repo,
             parents,
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1430,7 +1430,7 @@ 
 
     # By convention, ``extra['branch']`` (set by extrafn) clobbers
     # ``branch`` (used when passing ``--keepbranches``).
-    branch = repo[p1].branch()
+    branch = None
     if b'branch' in extra:
         branch = extra[b'branch']