tests/test-newbranch.t
author Pierre-Yves David <pierre-yves.david@fb.com>
Wed, 03 Jun 2015 14:29:11 -0700
branchstable
changeset 25425 9263f86b9681
parent 22363 9510b0e9480b
child 25295 701df761aa94
permissions -rw-r--r--
pull: avoid race condition with 'hg pull --rev name --update' (issue4706) The previous scheme was: 1) lookup node for all pulled revision, 2) pull said node 3) lookup the node of the checkout target 4) update the repository there. If the remote repo changes between (1) and (3), the resolved name will be different and (3) crash. There is actually no need for a remote lookup during (3), we could just set the value in (1). This prevent the race condition and save a possible network roundtrip.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
20185
7d4219512823 branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents: 18382
diff changeset
     1
  $ branchcache=.hg/cache/branch2
3420
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     2
18234
a55b06885cda branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18166
diff changeset
     3
  $ listbranchcaches() {
20185
7d4219512823 branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents: 18382
diff changeset
     4
  >    for f in .hg/cache/branch2*;
18234
a55b06885cda branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18166
diff changeset
     5
  >       do echo === $f ===;
a55b06885cda branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18166
diff changeset
     6
  >       cat $f;
a55b06885cda branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18166
diff changeset
     7
  >     done;
a55b06885cda branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18166
diff changeset
     8
  > }
a55b06885cda branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18166
diff changeset
     9
  $ purgebranchcaches() {
20185
7d4219512823 branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents: 18382
diff changeset
    10
  >     rm .hg/cache/branch2*
18234
a55b06885cda branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18166
diff changeset
    11
  > }
a55b06885cda branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18166
diff changeset
    12
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    13
  $ hg init t
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    14
  $ cd t
6160
3ee3bc5d06c5 tests: hide the name of the branch cache file
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5988
diff changeset
    15
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    16
  $ hg branches
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    17
  $ echo foo > a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    18
  $ hg add a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    19
  $ hg ci -m "initial"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    20
  $ hg branch foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    21
  marked working directory as branch foo
15615
41885892796e branch: warn on branching
Matt Mackall <mpm@selenic.com>
parents: 14198
diff changeset
    22
  (branches are permanent and global, did you want a bookmark?)
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    23
  $ hg branch
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    24
  foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    25
  $ hg ci -m "add branch name"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    26
  $ hg branch bar
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    27
  marked working directory as branch bar
15615
41885892796e branch: warn on branching
Matt Mackall <mpm@selenic.com>
parents: 14198
diff changeset
    28
  (branches are permanent and global, did you want a bookmark?)
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    29
  $ hg ci -m "change branch name"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    30
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    31
Branch shadowing:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    32
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    33
  $ hg branch default
14198
8f11fd321014 commands: use util.Abort's hint some more
Martin Geisler <mg@aragost.com>
parents: 14162
diff changeset
    34
  abort: a branch of the same name already exists
8f11fd321014 commands: use util.Abort's hint some more
Martin Geisler <mg@aragost.com>
parents: 14162
diff changeset
    35
  (use 'hg update' to switch to it)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12279
diff changeset
    36
  [255]
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    37
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    38
  $ hg branch -f default
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    39
  marked working directory as branch default
15615
41885892796e branch: warn on branching
Matt Mackall <mpm@selenic.com>
parents: 14198
diff changeset
    40
  (branches are permanent and global, did you want a bookmark?)
3420
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    41
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    42
  $ hg ci -m "clear branch name"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    43
  created new head
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    44
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    45
There should be only one default branch head
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    46
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    47
  $ hg heads .
14162
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
    48
  changeset:   3:1c28f494dae6
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    49
  tag:         tip
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    50
  user:        test
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    51
  date:        Thu Jan 01 00:00:00 1970 +0000
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    52
  summary:     clear branch name
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    53
  
22363
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    54
Merging and branches
3420
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    55
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    56
  $ hg co foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    57
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    58
  $ hg branch
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    59
  foo
22363
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    60
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    61
 set existing branch name fails unless force - setting existing parent branch works without force:
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    62
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    63
  $ hg branch bar
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    64
  abort: a branch of the same name already exists
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    65
  (use 'hg update' to switch to it)
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    66
  [255]
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    67
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    68
  $ hg branch -f bar
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    69
  marked working directory as branch bar
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    70
  (branches are permanent and global, did you want a bookmark?)
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    71
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    72
  $ hg branch foo
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    73
  marked working directory as branch foo
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    74
  (branches are permanent and global, did you want a bookmark?)
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    75
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    76
  $ echo bleah > a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    77
  $ hg ci -m "modify a branch"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    78
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    79
  $ hg merge default
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    80
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    81
  (branch merge, don't forget to commit)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    82
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    83
  $ hg branch
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    84
  foo
22363
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    85
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    86
 set existing branch name where branch head is ancestor:
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    87
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    88
  $ hg branch bar
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    89
  abort: a branch of the same name already exists
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    90
  (use 'hg update' to switch to it)
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    91
  [255]
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    92
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    93
 set (other) parent branch as branch name
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    94
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    95
  $ hg branch default
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    96
  marked working directory as branch default
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    97
  (branches are permanent and global, did you want a bookmark?)
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    98
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
    99
 set (first) parent branch as branch name
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   100
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   101
  $ hg branch foo
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   102
  marked working directory as branch foo
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   103
  (branches are permanent and global, did you want a bookmark?)
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   104
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   105
  $ hg ci -m "merge"
8954
e67e5b60e55f Branch heads should not include "heads" that are ancestors of other heads.
Brendan Cully <brendan@kublai.com>
parents: 7654
diff changeset
   106
22363
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   107
  $ hg log -G -T '{rev}:{node|short} {branch} {desc}\n'
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   108
  @    5:530046499edf foo merge
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   109
  |\
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   110
  | o  4:adf1a74a7f7b foo modify a branch
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   111
  | |
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   112
  o |  3:1c28f494dae6 default clear branch name
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   113
  | |
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   114
  o |  2:c21617b13b22 bar change branch name
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   115
  |/
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   116
  o  1:6c0e42da283a foo add branch name
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   117
  |
9510b0e9480b tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents: 21024
diff changeset
   118
  o  0:db01e8ea3388 default initial
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   119
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   120
  $ hg branches
14162
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
   121
  foo                            5:530046499edf
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
   122
  default                        3:1c28f494dae6 (inactive)
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
   123
  bar                            2:c21617b13b22 (inactive)
3420
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
   124
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   125
  $ hg branches -q
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   126
  foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   127
  default
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   128
  bar
3420
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
   129
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   130
Test for invalid branch cache:
3502
8dc14d630b29 add branch and branches commands
Matt Mackall <mpm@selenic.com>
parents: 3451
diff changeset
   131
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   132
  $ hg rollback
13446
1e497df514e2 rollback: clarifies the message about the reverted state (issue2628)
Gilles Moris <gilles.moris@free.fr>
parents: 13272
diff changeset
   133
  repository tip rolled back to revision 4 (undo commit)
13455
053c042118bc rollback, i18n: avoid parameterized message
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 13446
diff changeset
   134
  working directory now based on revisions 4 and 3
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   135
18382
f3b21beb9802 filtering: rename filters to their antonyms
Kevin Bullock <kbullock@ringworld.org>
parents: 18357
diff changeset
   136
  $ cp ${branchcache}-served .hg/bc-invalid
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   137
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   138
  $ hg log -r foo
14162
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
   139
  changeset:   4:adf1a74a7f7b
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   140
  branch:      foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   141
  tag:         tip
14162
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
   142
  parent:      1:6c0e42da283a
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   143
  user:        test
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   144
  date:        Thu Jan 01 00:00:00 1970 +0000
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   145
  summary:     modify a branch
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   146
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   147
  $ cp .hg/bc-invalid $branchcache
4175
fc12ac3755d5 Test update to branch tip
Brendan Cully <brendan@kublai.com>
parents: 4169
diff changeset
   148
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   149
  $ hg --debug log -r foo
14162
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
   150
  changeset:   4:adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   151
  branch:      foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   152
  tag:         tip
15907
51fc43253a52 changeset_printer: display changeset phase on debug level
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15615
diff changeset
   153
  phase:       draft
14162
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
   154
  parent:      1:6c0e42da283a56b5edc5b4fadb491365ec7f5fa8
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   155
  parent:      -1:0000000000000000000000000000000000000000
14162
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
   156
  manifest:    1:8c342a37dfba0b3d3ce073562a00d8a813c54ffe
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   157
  user:        test
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   158
  date:        Thu Jan 01 00:00:00 1970 +0000
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   159
  files:       a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   160
  extra:       branch=foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   161
  description:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   162
  modify a branch
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   163
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   164
  
18234
a55b06885cda branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18166
diff changeset
   165
  $ purgebranchcaches
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   166
  $ echo corrupted > $branchcache
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   167
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   168
  $ hg log -qr foo
14162
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
   169
  4:adf1a74a7f7b
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   170
18234
a55b06885cda branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18166
diff changeset
   171
  $ listbranchcaches
20185
7d4219512823 branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents: 18382
diff changeset
   172
  === .hg/cache/branch2 ===
18234
a55b06885cda branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18166
diff changeset
   173
  corrupted
20185
7d4219512823 branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents: 18382
diff changeset
   174
  === .hg/cache/branch2-served ===
14162
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
   175
  adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4
20185
7d4219512823 branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents: 18382
diff changeset
   176
  c21617b13b220988e7a2e26290fbe4325ffa7139 o bar
7d4219512823 branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents: 18382
diff changeset
   177
  1c28f494dae69a2f8fc815059d257eccf3fcfe75 o default
7d4219512823 branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents: 18382
diff changeset
   178
  adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 o foo
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   179
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   180
Push should update the branch cache:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   181
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   182
  $ hg init ../target
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   183
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   184
Pushing just rev 0:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   185
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   186
  $ hg push -qr 0 ../target
5988
ee317dbfb9d0 update the branch cache at the end of addchangegroup
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4410
diff changeset
   187
18234
a55b06885cda branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18166
diff changeset
   188
  $ (cd ../target/; listbranchcaches)
20185
7d4219512823 branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents: 18382
diff changeset
   189
  === .hg/cache/branch2-base ===
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   190
  db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0
20185
7d4219512823 branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents: 18382
diff changeset
   191
  db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 o default
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   192
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   193
Pushing everything:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   194
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   195
  $ hg push -qf ../target
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   196
18234
a55b06885cda branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18166
diff changeset
   197
  $ (cd ../target/; listbranchcaches)
20185
7d4219512823 branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents: 18382
diff changeset
   198
  === .hg/cache/branch2-base ===
14162
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
   199
  adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4
20185
7d4219512823 branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents: 18382
diff changeset
   200
  c21617b13b220988e7a2e26290fbe4325ffa7139 o bar
7d4219512823 branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents: 18382
diff changeset
   201
  1c28f494dae69a2f8fc815059d257eccf3fcfe75 o default
7d4219512823 branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents: 18382
diff changeset
   202
  adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 o foo
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   203
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   204
Update with no arguments: tipmost revision of the current branch:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   205
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   206
  $ hg up -q -C 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   207
  $ hg up -q
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   208
  $ hg id
14162
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
   209
  1c28f494dae6
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   210
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   211
  $ hg up -q 1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   212
  $ hg up -q
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   213
  $ hg id
14162
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
   214
  adf1a74a7f7b (foo) tip
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   215
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   216
  $ hg branch foobar
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   217
  marked working directory as branch foobar
15615
41885892796e branch: warn on branching
Matt Mackall <mpm@selenic.com>
parents: 14198
diff changeset
   218
  (branches are permanent and global, did you want a bookmark?)
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   219
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   220
  $ hg up
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   221
  abort: branch foobar not found
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12279
diff changeset
   222
  [255]
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   223
21024
7731a2281cf0 spelling: fixes from spell checker
Mads Kiilerich <madski@unity3d.com>
parents: 20185
diff changeset
   224
Fast-forward merge:
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   225
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   226
  $ hg branch ff
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   227
  marked working directory as branch ff
15615
41885892796e branch: warn on branching
Matt Mackall <mpm@selenic.com>
parents: 14198
diff changeset
   228
  (branches are permanent and global, did you want a bookmark?)
4231
83153299aab5 avoid a traceback with hg branch newbranch; hg up
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4179
diff changeset
   229
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   230
  $ echo ff > ff
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   231
  $ hg ci -Am'fast forward'
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   232
  adding ff
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   233
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   234
  $ hg up foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   235
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   236
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   237
  $ hg merge ff
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   238
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   239
  (branch merge, don't forget to commit)
4410
bbc97d419b16 Add fast-forward branch merging
Brendan Cully <brendan@kublai.com>
parents: 4232
diff changeset
   240
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   241
  $ hg branch
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   242
  foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   243
  $ hg commit -m'Merge ff into foo'
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   244
  $ hg parents
14162
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
   245
  changeset:   6:185ffbfefa30
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   246
  branch:      foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   247
  tag:         tip
14162
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
   248
  parent:      4:adf1a74a7f7b
301725c3df9a localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 13550
diff changeset
   249
  parent:      5:1a3c27dc5e11
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   250
  user:        test
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   251
  date:        Thu Jan 01 00:00:00 1970 +0000
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   252
  summary:     Merge ff into foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   253
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   254
  $ hg manifest
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   255
  a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   256
  ff
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   257
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   258
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   259
Test merging, add 3 default heads and one test head:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   260
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   261
  $ cd ..
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   262
  $ hg init merges
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   263
  $ cd merges
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   264
  $ echo a > a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   265
  $ hg ci -Ama
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   266
  adding a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   267
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   268
  $ echo b > b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   269
  $ hg ci -Amb
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   270
  adding b
6723
1fe6f365df2e merge: only in-branch merges can be implicit
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6160
diff changeset
   271
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   272
  $ hg up 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   273
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   274
  $ echo c > c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   275
  $ hg ci -Amc
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   276
  adding c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   277
  created new head
6723
1fe6f365df2e merge: only in-branch merges can be implicit
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6160
diff changeset
   278
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   279
  $ hg up 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   280
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   281
  $ echo d > d
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   282
  $ hg ci -Amd
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   283
  adding d
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   284
  created new head
6723
1fe6f365df2e merge: only in-branch merges can be implicit
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6160
diff changeset
   285
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   286
  $ hg up 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   287
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   288
  $ hg branch test
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   289
  marked working directory as branch test
15615
41885892796e branch: warn on branching
Matt Mackall <mpm@selenic.com>
parents: 14198
diff changeset
   290
  (branches are permanent and global, did you want a bookmark?)
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   291
  $ echo e >> e
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   292
  $ hg ci -Ame
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   293
  adding e
6723
1fe6f365df2e merge: only in-branch merges can be implicit
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6160
diff changeset
   294
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   295
  $ hg log
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   296
  changeset:   4:3a1e01ed1df4
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   297
  branch:      test
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   298
  tag:         tip
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   299
  parent:      0:cb9a9f314b8b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   300
  user:        test
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   301
  date:        Thu Jan 01 00:00:00 1970 +0000
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   302
  summary:     e
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   303
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   304
  changeset:   3:980f7dc84c29
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   305
  parent:      0:cb9a9f314b8b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   306
  user:        test
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   307
  date:        Thu Jan 01 00:00:00 1970 +0000
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   308
  summary:     d
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   309
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   310
  changeset:   2:d36c0562f908
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   311
  parent:      0:cb9a9f314b8b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   312
  user:        test
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   313
  date:        Thu Jan 01 00:00:00 1970 +0000
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   314
  summary:     c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   315
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   316
  changeset:   1:d2ae7f538514
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   317
  user:        test
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   318
  date:        Thu Jan 01 00:00:00 1970 +0000
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   319
  summary:     b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   320
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   321
  changeset:   0:cb9a9f314b8b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   322
  user:        test
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   323
  date:        Thu Jan 01 00:00:00 1970 +0000
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   324
  summary:     a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   325
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   326
Implicit merge with test branch as parent:
6723
1fe6f365df2e merge: only in-branch merges can be implicit
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6160
diff changeset
   327
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   328
  $ hg merge
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   329
  abort: branch 'test' has one head - please merge with an explicit rev
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   330
  (run 'hg heads' to see all heads)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12279
diff changeset
   331
  [255]
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   332
  $ hg up -C default
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   333
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   334
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   335
Implicit merge with default branch as parent:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   336
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   337
  $ hg merge
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   338
  abort: branch 'default' has 3 heads - please merge with an explicit rev
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   339
  (run 'hg heads .' to see heads)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12279
diff changeset
   340
  [255]
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   341
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   342
3 branch heads, explicit merge required:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   343
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   344
  $ hg merge 2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   345
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   346
  (branch merge, don't forget to commit)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   347
  $ hg ci -m merge
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   348
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   349
2 branch heads, implicit merge works:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   350
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   351
  $ hg merge
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   352
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   353
  (branch merge, don't forget to commit)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   354
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15907
diff changeset
   355
  $ cd ..