Patchwork [6,of,6,misc] rebase: tell when reopening a closed branch head

login
register
mail settings
Submitter Mads Kiilerich
Date April 13, 2014, 5:13 p.m.
Message ID <8a72855095f4daddcd49.1397409230@localhost.localdomain>
Download mbox | patch
Permalink /patch/4334/
State Accepted
Commit bd4cc41234760cb1fc9a822eada1c37e5852c2b7
Headers show

Comments

Mads Kiilerich - April 13, 2014, 5:13 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@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.
Augie Fackler - April 14, 2014, 2:37 a.m.
Queued 1-4, 6 on a plane (and so I may be racing other people while I'm in a partition).

Thanks!

On Apr 13, 2014, at 1:13 PM, Mads Kiilerich <mads@kiilerich.com> wrote:

> # HG changeset patch
> # User Mads Kiilerich <madski@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
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

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