Mercurial > hg
annotate tests/test-newbranch.t @ 23025:b8dd8432395d
test-resolve.t: use redirection to /dev/null instead of grep -q
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 17 Oct 2014 11:01:05 -0400 |
parents | 9510b0e9480b |
children | 701df761aa94 |
rev | line source |
---|---|
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 | 13 $ hg init t |
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 | 16 $ hg branches |
17 $ echo foo > a | |
18 $ hg add a | |
19 $ hg ci -m "initial" | |
20 $ hg branch foo | |
21 marked working directory as branch foo | |
15615 | 22 (branches are permanent and global, did you want a bookmark?) |
12279 | 23 $ hg branch |
24 foo | |
25 $ hg ci -m "add branch name" | |
26 $ hg branch bar | |
27 marked working directory as branch bar | |
15615 | 28 (branches are permanent and global, did you want a bookmark?) |
12279 | 29 $ hg ci -m "change branch name" |
30 | |
31 Branch shadowing: | |
32 | |
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 | 37 |
38 $ hg branch -f default | |
39 marked working directory as branch default | |
15615 | 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 | 42 $ hg ci -m "clear branch name" |
43 created new head | |
44 | |
45 There should be only one default branch head | |
46 | |
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 | 49 tag: tip |
50 user: test | |
51 date: Thu Jan 01 00:00:00 1970 +0000 | |
52 summary: clear branch name | |
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 | 56 $ hg co foo |
57 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
58 $ hg branch | |
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 | 76 $ echo bleah > a |
77 $ hg ci -m "modify a branch" | |
78 | |
79 $ hg merge default | |
80 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
81 (branch merge, don't forget to commit) | |
82 | |
83 $ hg branch | |
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 | 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 | 119 |
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 | 125 $ hg branches -q |
126 foo | |
127 default | |
128 bar | |
3420
2576b6731524
Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
129 |
12279 | 130 Test for invalid branch cache: |
3502
8dc14d630b29
add branch and branches commands
Matt Mackall <mpm@selenic.com>
parents:
3451
diff
changeset
|
131 |
12279 | 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 | 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 | 137 |
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 | 140 branch: foo |
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 | 143 user: test |
144 date: Thu Jan 01 00:00:00 1970 +0000 | |
145 summary: modify a branch | |
146 | |
147 $ cp .hg/bc-invalid $branchcache | |
4175
fc12ac3755d5
Test update to branch tip
Brendan Cully <brendan@kublai.com>
parents:
4169
diff
changeset
|
148 |
12279 | 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 | 151 branch: foo |
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 | 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 | 157 user: test |
158 date: Thu Jan 01 00:00:00 1970 +0000 | |
159 files: a | |
160 extra: branch=foo | |
161 description: | |
162 modify a branch | |
163 | |
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 | 166 $ echo corrupted > $branchcache |
167 | |
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 | 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 | 179 |
180 Push should update the branch cache: | |
181 | |
182 $ hg init ../target | |
183 | |
184 Pushing just rev 0: | |
185 | |
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 | 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 | 192 |
193 Pushing everything: | |
194 | |
195 $ hg push -qf ../target | |
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 | 203 |
204 Update with no arguments: tipmost revision of the current branch: | |
205 | |
206 $ hg up -q -C 0 | |
207 $ hg up -q | |
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 | 210 |
211 $ hg up -q 1 | |
212 $ hg up -q | |
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 | 215 |
216 $ hg branch foobar | |
217 marked working directory as branch foobar | |
15615 | 218 (branches are permanent and global, did you want a bookmark?) |
12279 | 219 |
220 $ hg up | |
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 | 223 |
21024
7731a2281cf0
spelling: fixes from spell checker
Mads Kiilerich <madski@unity3d.com>
parents:
20185
diff
changeset
|
224 Fast-forward merge: |
12279 | 225 |
226 $ hg branch ff | |
227 marked working directory as branch ff | |
15615 | 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 | 230 $ echo ff > ff |
231 $ hg ci -Am'fast forward' | |
232 adding ff | |
233 | |
234 $ hg up foo | |
235 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
236 | |
237 $ hg merge ff | |
238 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
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 | 241 $ hg branch |
242 foo | |
243 $ hg commit -m'Merge ff into foo' | |
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 | 246 branch: foo |
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 | 250 user: test |
251 date: Thu Jan 01 00:00:00 1970 +0000 | |
252 summary: Merge ff into foo | |
253 | |
254 $ hg manifest | |
255 a | |
256 ff | |
257 | |
258 | |
259 Test merging, add 3 default heads and one test head: | |
260 | |
261 $ cd .. | |
262 $ hg init merges | |
263 $ cd merges | |
264 $ echo a > a | |
265 $ hg ci -Ama | |
266 adding a | |
267 | |
268 $ echo b > b | |
269 $ hg ci -Amb | |
270 adding b | |
6723
1fe6f365df2e
merge: only in-branch merges can be implicit
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6160
diff
changeset
|
271 |
12279 | 272 $ hg up 0 |
273 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
274 $ echo c > c | |
275 $ hg ci -Amc | |
276 adding c | |
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 | 279 $ hg up 0 |
280 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
281 $ echo d > d | |
282 $ hg ci -Amd | |
283 adding d | |
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 | 286 $ hg up 0 |
287 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
288 $ hg branch test | |
289 marked working directory as branch test | |
15615 | 290 (branches are permanent and global, did you want a bookmark?) |
12279 | 291 $ echo e >> e |
292 $ hg ci -Ame | |
293 adding e | |
6723
1fe6f365df2e
merge: only in-branch merges can be implicit
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6160
diff
changeset
|
294 |
12279 | 295 $ hg log |
296 changeset: 4:3a1e01ed1df4 | |
297 branch: test | |
298 tag: tip | |
299 parent: 0:cb9a9f314b8b | |
300 user: test | |
301 date: Thu Jan 01 00:00:00 1970 +0000 | |
302 summary: e | |
303 | |
304 changeset: 3:980f7dc84c29 | |
305 parent: 0:cb9a9f314b8b | |
306 user: test | |
307 date: Thu Jan 01 00:00:00 1970 +0000 | |
308 summary: d | |
309 | |
310 changeset: 2:d36c0562f908 | |
311 parent: 0:cb9a9f314b8b | |
312 user: test | |
313 date: Thu Jan 01 00:00:00 1970 +0000 | |
314 summary: c | |
315 | |
316 changeset: 1:d2ae7f538514 | |
317 user: test | |
318 date: Thu Jan 01 00:00:00 1970 +0000 | |
319 summary: b | |
320 | |
321 changeset: 0:cb9a9f314b8b | |
322 user: test | |
323 date: Thu Jan 01 00:00:00 1970 +0000 | |
324 summary: a | |
325 | |
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 | 328 $ hg merge |
329 abort: branch 'test' has one head - please merge with an explicit rev | |
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 | 332 $ hg up -C default |
333 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
334 | |
335 Implicit merge with default branch as parent: | |
336 | |
337 $ hg merge | |
338 abort: branch 'default' has 3 heads - please merge with an explicit rev | |
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 | 341 |
342 3 branch heads, explicit merge required: | |
343 | |
344 $ hg merge 2 | |
345 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
346 (branch merge, don't forget to commit) | |
347 $ hg ci -m merge | |
348 | |
349 2 branch heads, implicit merge works: | |
350 | |
351 $ hg merge | |
352 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
353 (branch merge, don't forget to commit) | |
354 | |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
15907
diff
changeset
|
355 $ cd .. |