tests/test-branch-change.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Mon, 12 Jul 2021 00:14:11 +0200
changeset 47615 a8d1adeeba87
parent 47271 055f7b9f2307
child 48116 5ced12cfa41b
permissions -rw-r--r--
test-sigpipe: run the hook using `sh` This make the hook properly run on Windows. Differential Revision: https://phab.mercurial-scm.org/D11084
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     1
Testing changing branch on commits
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     2
==================================
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     3
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     4
Setup
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     5
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     6
  $ cat >> $HGRCPATH << EOF
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     7
  > [alias]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     8
  > glog = log -G -T "{rev}:{node|short} {desc}\n{branch} ({bookmarks})"
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     9
  > [experimental]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    10
  > evolution = createmarkers
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    11
  > [extensions]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    12
  > rebase=
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    13
  > EOF
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    14
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    15
  $ hg init repo
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    16
  $ cd repo
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    17
  $ for ch in a b c d e; do echo foo >> $ch; hg ci -Aqm "Added "$ch; done
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    18
  $ hg glog
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    19
  @  4:aa98ab95a928 Added e
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    20
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    21
  o  3:62615734edd5 Added d
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    22
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    23
  o  2:28ad74487de9 Added c
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    24
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    25
  o  1:29becc82797a Added b
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    26
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    27
  o  0:18d04c59bb5d Added a
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    28
     default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    29
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    30
  $ hg branches
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    31
  default                        4:aa98ab95a928
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    32
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    33
Try without passing a new branch name
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    34
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    35
  $ hg branch -r .
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    36
  abort: no branch name specified for the revisions
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 44401
diff changeset
    37
  [10]
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    38
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    39
Setting an invalid branch name
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    40
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    41
  $ hg branch -r . a:b
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    42
  abort: ':' cannot be used in a name
45845
f96fa4de5055 errors: use InputError for errors about bad label names (tags etc)
Martin von Zweigbergk <martinvonz@google.com>
parents: 45840
diff changeset
    43
  [10]
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    44
  $ hg branch -r . tip
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    45
  abort: the name 'tip' is reserved
45845
f96fa4de5055 errors: use InputError for errors about bad label names (tags etc)
Martin von Zweigbergk <martinvonz@google.com>
parents: 45840
diff changeset
    46
  [10]
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    47
  $ hg branch -r . 1234
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    48
  abort: cannot use an integer as a name
45845
f96fa4de5055 errors: use InputError for errors about bad label names (tags etc)
Martin von Zweigbergk <martinvonz@google.com>
parents: 45840
diff changeset
    49
  [10]
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    50
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    51
Change on non-linear set of commits
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    52
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    53
  $ hg branch -r 2 -r 4 foo
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    54
  abort: cannot change branch of non-linear revisions
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 44401
diff changeset
    55
  [10]
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    56
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    57
Change in middle of the stack (linear commits)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    58
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    59
  $ hg branch -r 1::3 foo
47070
d90f6237b3aa rewriteutil: say how many commits would become orphan if commit is rewritten
Martin von Zweigbergk <martinvonz@google.com>
parents: 47069
diff changeset
    60
  abort: cannot change branch of changeset, as that will orphan 1 descendants
47018
7a90fddb13b0 rewriteutil: point to help about instability when rewriting creates orphan
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
    61
  (see 'hg help evolution.instability')
45853
b4694ef45db5 errors: raise more specific errors from rewriteutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 45845
diff changeset
    62
  [10]
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    63
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    64
Change with dirty working directory
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    65
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    66
  $ echo bar > a
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    67
  $ hg branch -r . foo
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    68
  abort: uncommitted changes
45840
527ce85c2e60 errors: introduce StateError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 45827
diff changeset
    69
  [20]
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    70
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    71
  $ hg revert --all
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    72
  reverting a
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    73
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    74
Change on empty revision set
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    75
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    76
  $ hg branch -r 'draft() - all()' foo
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    77
  abort: empty revision set
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 44401
diff changeset
    78
  [10]
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    79
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    80
Changing branch on linear set of commits from head
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    81
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    82
Without obsmarkers
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    83
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    84
  $ hg branch -r 3:4 foo --config experimental.evolution=!
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    85
  changed branch on 2 changesets
35771
ebb75443969a test-branch-change: stabilize for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35746
diff changeset
    86
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/62615734edd5-e86bd13a-branch-change.hg
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    87
  $ hg glog
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    88
  @  4:3938acfb5c0f Added e
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    89
  |  foo ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    90
  o  3:9435da006bdc Added d
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    91
  |  foo ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    92
  o  2:28ad74487de9 Added c
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    93
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    94
  o  1:29becc82797a Added b
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    95
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    96
  o  0:18d04c59bb5d Added a
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    97
     default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    98
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    99
  $ hg branches
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   100
  foo                            4:3938acfb5c0f
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   101
  default                        2:28ad74487de9 (inactive)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   102
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   103
With obsmarkers
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   104
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   105
  $ hg branch -r 3::4 bar
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   106
  changed branch on 2 changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   107
  $ hg glog
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   108
  @  6:7c1991464886 Added e
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   109
  |  bar ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   110
  o  5:1ea05e93925f Added d
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   111
  |  bar ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   112
  o  2:28ad74487de9 Added c
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   113
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   114
  o  1:29becc82797a Added b
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   115
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   116
  o  0:18d04c59bb5d Added a
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   117
     default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   118
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   119
  $ hg branches
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   120
  bar                            6:7c1991464886
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   121
  default                        2:28ad74487de9 (inactive)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   122
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   123
Change branch name to an existing branch
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   124
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   125
  $ hg branch -r . default
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   126
  abort: a branch of the same name already exists
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 44401
diff changeset
   127
  [10]
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   128
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   129
Changing on a branch head which is not topological head
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   130
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   131
  $ hg branch -r 2 stable
47070
d90f6237b3aa rewriteutil: say how many commits would become orphan if commit is rewritten
Martin von Zweigbergk <martinvonz@google.com>
parents: 47069
diff changeset
   132
  abort: cannot change branch of changeset, as that will orphan 2 descendants
47018
7a90fddb13b0 rewriteutil: point to help about instability when rewriting creates orphan
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
   133
  (see 'hg help evolution.instability')
45853
b4694ef45db5 errors: raise more specific errors from rewriteutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 45845
diff changeset
   134
  [10]
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   135
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   136
Enabling the allowunstable config and trying to change branch on a branch head
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   137
which is not a topological head
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   138
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   139
  $ echo "[experimental]" >> .hg/hgrc
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   140
  $ echo "evolution.allowunstable=yes" >> .hg/hgrc
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   141
  $ hg branch -r 2 foo
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   142
  changed branch on 1 changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   143
  2 new orphan changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   144
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   145
Changing branch of an obsoleted changeset
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   146
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   147
  $ hg branch -r 4 foobar
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45853
diff changeset
   148
  abort: hidden revision '4' was rewritten as: 7c1991464886
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   149
  (use --hidden to access hidden revisions)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   150
  [255]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   151
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   152
  $ hg branch -r 4 --hidden foobar
47020
ba6881c6a178 rewriteutil: check for divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 47018
diff changeset
   153
  abort: cannot change branch of 3938acfb5c0f, as that creates content-divergence with 7c1991464886
47271
055f7b9f2307 rewriteutil: add pointer to help text when rewrite would cause divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 47070
diff changeset
   154
  (add --verbose for details or see 'hg help evolution.instability')
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 44401
diff changeset
   155
  [10]
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   156
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   157
Make sure bookmark movement is correct
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   158
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   159
  $ hg bookmark b1
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   160
  $ hg glog -r '.^::'
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   161
  @  6:7c1991464886 Added e
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   162
  |  bar (b1)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   163
  *  5:1ea05e93925f Added d
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   164
  |  bar ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   165
  ~
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   166
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   167
  $ hg branch -r '(.^)::' wat --debug
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   168
  changing branch of '1ea05e93925f806d875a2163f9b76764be644636' from 'bar' to 'wat'
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   169
  committing files:
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   170
  d
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   171
  committing manifest
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   172
  committing changelog
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   173
  new node id is 343660ccab7400da637bd6a211d07f413536d718
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   174
  changing branch of '7c19914648869f5b02fc7fed31ddee9783fdd680' from 'bar' to 'wat'
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   175
  committing files:
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   176
  e
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   177
  committing manifest
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   178
  committing changelog
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   179
  new node id is de1404b45a69f8cc6437d7679033ee33e9efb4ba
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   180
  moving bookmarks ['b1'] from 7c19914648869f5b02fc7fed31ddee9783fdd680 to de1404b45a69f8cc6437d7679033ee33e9efb4ba
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   181
  resolving manifests
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   182
   branchmerge: False, force: False, partial: False
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   183
   ancestor: 7c1991464886, local: 7c1991464886+, remote: de1404b45a69
35771
ebb75443969a test-branch-change: stabilize for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35746
diff changeset
   184
  starting 4 threads for background file closing (?)
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   185
  changed branch on 2 changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   186
  updating the branch cache
42602
c7d236b55a3e py3: fix formatting of branchmap log messages with repo.filtername=None
Martin von Zweigbergk <martinvonz@google.com>
parents: 40666
diff changeset
   187
  invalid branch cache (served): tip differs
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   188
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   189
  $ hg glog -r '(.^)::'
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   190
  @  9:de1404b45a69 Added e
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   191
  |  wat (b1)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   192
  *  8:343660ccab74 Added d
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   193
  |  wat ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   194
  ~
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   195
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   196
Make sure phase handling is correct
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   197
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   198
  $ echo foo >> bar
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   199
  $ hg ci -Aqm "added bar" --secret
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   200
  1 new orphan changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   201
  $ hg glog -r .
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   202
  @  10:8ad1294c1660 added bar
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   203
  |  wat (b1)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   204
  ~
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   205
  $ hg branch -r . secret
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   206
  changed branch on 1 changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   207
  $ hg phase -r .
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   208
  11: secret
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   209
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   210
  $ hg branches
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   211
  secret                        11:38a9b2d53f98
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   212
  foo                            7:8a4729a5e2b8
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   213
  wat                            9:de1404b45a69 (inactive)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   214
  default                        2:28ad74487de9 (inactive)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   215
  $ hg branch
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   216
  secret
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   217
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   218
Changing branch of another head, different from one on which we are
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   219
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   220
  $ hg glog
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   221
  @  11:38a9b2d53f98 added bar
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   222
  |  secret (b1)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   223
  *  9:de1404b45a69 Added e
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   224
  |  wat ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   225
  *  8:343660ccab74 Added d
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   226
  |  wat ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   227
  | o  7:8a4729a5e2b8 Added c
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   228
  | |  foo ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   229
  x |  2:28ad74487de9 Added c
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   230
  |/   default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   231
  o  1:29becc82797a Added b
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   232
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   233
  o  0:18d04c59bb5d Added a
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   234
     default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   235
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   236
  $ hg branch
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   237
  secret
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   238
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   239
  $ hg branch -r 7 foobar
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   240
  changed branch on 1 changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   241
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   242
The current branch must be preserved
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   243
  $ hg branch
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   244
  secret
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   245
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   246
Changing branch on multiple heads at once
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   247
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   248
  $ hg rebase -s 8 -d 12 --keepbranches -q
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   249
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   250
  $ hg rebase -s 14 -d 1 --keepbranches -q
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   251
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   252
  $ hg branch -r 0: stable
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   253
  changed branch on 6 changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   254
  $ hg glog
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   255
  @  23:6a5ddbcfb870 added bar
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   256
  |  stable (b1)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   257
  o  22:baedc6e98a67 Added e
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   258
  |  stable ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   259
  | o  21:99ac7bf8aad1 Added d
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   260
  | |  stable ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   261
  | o  20:0ecb4d39c4bd Added c
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   262
  |/   stable ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   263
  o  19:fd45b986b109 Added b
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   264
  |  stable ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   265
  o  18:204d2769eca2 Added a
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   266
     stable ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   267
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   268
  $ hg branches
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   269
  stable                        23:6a5ddbcfb870
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   270
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   271
  $ hg branch
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   272
  stable
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   273
35746
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   274
Changing to same branch is no-op
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   275
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   276
  $ hg branch -r 19::21 stable
35746
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   277
  changed branch on 0 changesets
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   278
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   279
Changing branch name to existing branch name if the branch of parent of root of
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   280
revs is same as the new branch name
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   281
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   282
  $ hg branch -r 20::21 bugfix
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   283
  changed branch on 2 changesets
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   284
  $ hg glog
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   285
  o  25:714defe1cf34 Added d
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   286
  |  bugfix ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   287
  o  24:98394def28fc Added c
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   288
  |  bugfix ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   289
  | @  23:6a5ddbcfb870 added bar
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   290
  | |  stable (b1)
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   291
  | o  22:baedc6e98a67 Added e
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   292
  |/   stable ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   293
  o  19:fd45b986b109 Added b
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   294
  |  stable ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   295
  o  18:204d2769eca2 Added a
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   296
     stable ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   297
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   298
  $ hg branch -r 24:25 stable
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   299
  changed branch on 2 changesets
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   300
  $ hg glog
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   301
  o  27:4ec342341562 Added d
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   302
  |  stable ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   303
  o  26:83f48859c2de Added c
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   304
  |  stable ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   305
  | @  23:6a5ddbcfb870 added bar
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   306
  | |  stable (b1)
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   307
  | o  22:baedc6e98a67 Added e
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   308
  |/   stable ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   309
  o  19:fd45b986b109 Added b
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   310
  |  stable ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   311
  o  18:204d2769eca2 Added a
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   312
     stable ()
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   313
40666
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   314
Changing branch of a merge commit
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   315
40666
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   316
  $ hg branch -q ghi
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   317
  $ echo f > f
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   318
  $ hg ci -qAm 'Added f'
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   319
  $ hg up -q 27
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   320
  $ hg branch -q jkl
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   321
  $ echo g > g
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   322
  $ hg ci -qAm 'Added g'
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   323
  $ hg glog -r 'heads(:)'
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   324
  @  29:6bc1c6c2c9da Added g
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   325
  |  jkl ()
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   326
  ~
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   327
  o  28:2f1019bd29d2 Added f
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   328
  |  ghi (b1)
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   329
  ~
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   330
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   331
  $ hg branch -q default
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   332
  $ hg merge -r 28
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   333
  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   334
  (branch merge, don't forget to commit)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   335
  $ hg branch -r . abcd
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   336
  abort: outstanding uncommitted merge
45840
527ce85c2e60 errors: introduce StateError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 45827
diff changeset
   337
  [20]
40666
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   338
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   339
  $ hg ci -m "Merge commit"
40666
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   340
  $ hg glog -r 'parents(.)::'
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   341
  @    30:4d56e6b1eb6b Merge commit
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   342
  |\   default ()
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   343
  | o  29:6bc1c6c2c9da Added g
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   344
  | |  jkl ()
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   345
  | ~
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   346
  o  28:2f1019bd29d2 Added f
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   347
  |  ghi (b1)
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   348
  ~
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   349
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   350
  $ hg branch -r . ghi
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   351
  0 files updated, 0 files merged, 4 files removed, 0 files unresolved
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   352
  changed branch on 1 changesets
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   353
  $ hg branch -r . jkl
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   354
  changed branch on 1 changesets
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   355
  $ hg branch -r . default
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   356
  changed branch on 1 changesets
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   357
  $ hg branch -r . stable
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   358
  abort: a branch of the same name already exists
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 44401
diff changeset
   359
  [10]
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   360
44401
92b7caf4cb9e branch: make --force work even when specifying revs
Manuel Jacob <me@manueljacob.de>
parents: 42602
diff changeset
   361
  $ hg branch -r . stable --force
92b7caf4cb9e branch: make --force work even when specifying revs
Manuel Jacob <me@manueljacob.de>
parents: 42602
diff changeset
   362
  changed branch on 1 changesets
92b7caf4cb9e branch: make --force work even when specifying revs
Manuel Jacob <me@manueljacob.de>
parents: 42602
diff changeset
   363
  $ hg branches
92b7caf4cb9e branch: make --force work even when specifying revs
Manuel Jacob <me@manueljacob.de>
parents: 42602
diff changeset
   364
  stable                        34:d1c2addda4a2
92b7caf4cb9e branch: make --force work even when specifying revs
Manuel Jacob <me@manueljacob.de>
parents: 42602
diff changeset
   365
  jkl                           29:6bc1c6c2c9da (inactive)
92b7caf4cb9e branch: make --force work even when specifying revs
Manuel Jacob <me@manueljacob.de>
parents: 42602
diff changeset
   366
  ghi                           28:2f1019bd29d2 (inactive)
92b7caf4cb9e branch: make --force work even when specifying revs
Manuel Jacob <me@manueljacob.de>
parents: 42602
diff changeset
   367
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   368
Changing branch on public changeset
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   369
40666
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   370
  $ hg phase -r . -p
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   371
  $ hg branch -r . def
47069
5b6dd0d9171b rewriteutil: give examples of public changesets that can't be rewritten
Martin von Zweigbergk <martinvonz@google.com>
parents: 47020
diff changeset
   372
  abort: cannot change branch of public changesets: d1c2addda4a2
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   373
  (see 'hg help phases' for details)
45853
b4694ef45db5 errors: raise more specific errors from rewriteutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 45845
diff changeset
   374
  [10]
40666
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   375
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   376
Merge commit with conflicts, with evolution and without
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   377
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   378
  $ mklozenge() {
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   379
  >   echo foo > a
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   380
  >   hg ci -qAm foo
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   381
  >   echo bar > a
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   382
  >   hg ci -qm bar
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   383
  >   hg up -q '.^'
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   384
  >   echo baz > a
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   385
  >   hg ci -qm baz
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   386
  >   hg merge -q -t :local
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   387
  >   echo neither > a
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   388
  >   hg ci -qm neither
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   389
  > }
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   390
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   391
  $ cd ..
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   392
  $ hg init merge-with-evolution
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   393
  $ cd merge-with-evolution
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   394
  $ mklozenge
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   395
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   396
  $ hg branch -r '(.^)::' abc
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   397
  changed branch on 2 changesets
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   398
  $ hg glog
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   399
  @    5:c07fa8b34d54 neither
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   400
  |\   abc ()
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   401
  | o  4:f2aa51777cc9 baz
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   402
  | |  abc ()
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   403
  o |  1:2e33c4f0856b bar
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   404
  |/   default ()
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   405
  o  0:91cfb6004abf foo
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   406
     default ()
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   407
  $ hg cat a
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   408
  neither
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   409
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   410
  $ cd ..
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   411
  $ hg init merge-without-evolution
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   412
  $ cd merge-without-evolution
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   413
  $ mklozenge
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   414
  $ cat > .hg/hgrc << EOF
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   415
  > [experimental]
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   416
  > evolution = no
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   417
  > evolution.allowunstable = no
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   418
  > EOF
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   419
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   420
  $ hg branch -r '(.^)::' abc
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   421
  changed branch on 2 changesets
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   422
  saved backup bundle to $TESTTMP/merge-without-evolution/.hg/strip-backup/9a3a2af368f4-8db1a361-branch-change.hg
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   423
  $ hg glog
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   424
  @    3:c07fa8b34d54 neither
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   425
  |\   abc ()
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   426
  | o  2:f2aa51777cc9 baz
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   427
  | |  abc ()
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   428
  o |  1:2e33c4f0856b bar
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   429
  |/   default ()
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   430
  o  0:91cfb6004abf foo
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   431
     default ()
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   432
  $ hg cat a
69268a13ffa5 branch: allow changing branch of merge commits with --rev
Anton Shestakov <av6@dwimlabs.net>
parents: 35771
diff changeset
   433
  neither