[PATCH 6 of 6 misc] rebase: tell when reopening a closed branch head
Mads Kiilerich
mads at kiilerich.com
Sun Apr 13 17:13:50 UTC 2014
# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1385432336 -3600
# Tue Nov 26 03:18:56 2013 +0100
# Node ID 8a72855095f4daddcd49440cdc692938adf3093a
# Parent 52bdb665e6938025c57a2d745de1306aa9439a9f
rebase: tell when reopening a closed branch head
Give same 'reopening closed branch head X' message as commit gives.
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -289,6 +289,9 @@ def rebase(ui, repo, **opts):
inclusive=True)
external = externalparent(repo, state, targetancestors)
+ if dest.closesbranch() and not keepbranchesf:
+ ui.status(_('reopening closed branch head %s\n') % dest)
+
if keepbranchesf:
# insert _savebranch at the start of extrafns so if
# there's a user-provided extrafn it can clobber branch if
diff --git a/tests/test-rebase-named-branches.t b/tests/test-rebase-named-branches.t
--- a/tests/test-rebase-named-branches.t
+++ b/tests/test-rebase-named-branches.t
@@ -239,6 +239,17 @@ Rebasing descendant onto ancestor across
|/
@ 0: 'A'
+
+Reopen branch by rebase
+
+ $ hg up -qr3
+ $ hg branch -q b
+ $ hg ci -m 'create b'
+ $ hg ci -m 'close b' --close
+ $ hg rebase -b 8 -d b
+ reopening closed branch head ea9de14a36c6
+ saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
+
$ cd ..
Rebase to other head on branch
More information about the Mercurial-devel
mailing list