author | Yuya Nishihara <yuya@tcha.org> |
Fri, 18 May 2018 21:32:05 +0900 | |
branch | stable |
changeset 38039 | 5b831053d9b6 |
parent 29284 | 1c7167009936 |
child 43114 | 8197b395710e |
permissions | -rw-r--r-- |
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 |
|
28 |
$ hg ci -m "change branch name" |
|
29 |
||
30 |
Branch shadowing: |
|
31 |
||
32 |
$ hg branch default |
|
14198
8f11fd321014
commands: use util.Abort's hint some more
Martin Geisler <mg@aragost.com>
parents:
14162
diff
changeset
|
33 |
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
|
34 |
(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
|
35 |
[255] |
12279 | 36 |
|
37 |
$ hg branch -f default |
|
38 |
marked working directory as branch default |
|
3420
2576b6731524
Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
39 |
|
12279 | 40 |
$ hg ci -m "clear branch name" |
41 |
created new head |
|
42 |
||
43 |
There should be only one default branch head |
|
44 |
||
45 |
$ 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
|
46 |
changeset: 3:1c28f494dae6 |
12279 | 47 |
tag: tip |
48 |
user: test |
|
49 |
date: Thu Jan 01 00:00:00 1970 +0000 |
|
50 |
summary: clear branch name |
|
51 |
||
22363
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
52 |
Merging and branches |
3420
2576b6731524
Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
53 |
|
12279 | 54 |
$ hg co foo |
55 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
56 |
$ hg branch |
|
57 |
foo |
|
22363
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
58 |
|
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
59 |
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
|
60 |
|
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
61 |
$ hg branch bar |
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
62 |
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
|
63 |
(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
|
64 |
[255] |
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
65 |
|
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
66 |
$ hg branch -f bar |
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
67 |
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
|
68 |
|
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
69 |
$ hg branch foo |
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
70 |
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
|
71 |
|
12279 | 72 |
$ echo bleah > a |
73 |
$ hg ci -m "modify a branch" |
|
74 |
||
75 |
$ hg merge default |
|
76 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
77 |
(branch merge, don't forget to commit) |
|
78 |
||
79 |
$ hg branch |
|
80 |
foo |
|
22363
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
81 |
|
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
82 |
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
|
83 |
|
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
84 |
$ hg branch bar |
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
85 |
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
|
86 |
(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
|
87 |
[255] |
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
88 |
|
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
89 |
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
|
90 |
|
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
91 |
$ hg branch default |
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
92 |
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
|
93 |
|
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
94 |
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
|
95 |
|
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
96 |
$ hg branch foo |
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
97 |
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
|
98 |
|
12279 | 99 |
$ 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
|
100 |
|
22363
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
101 |
$ 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
|
102 |
@ 5:530046499edf foo merge |
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
103 |
|\ |
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
104 |
| 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
|
105 |
| | |
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
106 |
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
|
107 |
| | |
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
108 |
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
|
109 |
|/ |
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
110 |
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
|
111 |
| |
9510b0e9480b
tests: improve test coverage of branch command and existing branches
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
112 |
o 0:db01e8ea3388 default initial |
12279 | 113 |
|
114 |
$ 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
|
115 |
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
|
116 |
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
|
117 |
bar 2:c21617b13b22 (inactive) |
3420
2576b6731524
Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
118 |
|
12279 | 119 |
$ hg branches -q |
120 |
foo |
|
121 |
default |
|
122 |
bar |
|
3420
2576b6731524
Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
123 |
|
12279 | 124 |
Test for invalid branch cache: |
3502
8dc14d630b29
add branch and branches commands
Matt Mackall <mpm@selenic.com>
parents:
3451
diff
changeset
|
125 |
|
12279 | 126 |
$ hg rollback |
13446
1e497df514e2
rollback: clarifies the message about the reverted state (issue2628)
Gilles Moris <gilles.moris@free.fr>
parents:
13272
diff
changeset
|
127 |
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
|
128 |
working directory now based on revisions 4 and 3 |
12279 | 129 |
|
18382
f3b21beb9802
filtering: rename filters to their antonyms
Kevin Bullock <kbullock@ringworld.org>
parents:
18357
diff
changeset
|
130 |
$ cp ${branchcache}-served .hg/bc-invalid |
12279 | 131 |
|
132 |
$ 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
|
133 |
changeset: 4:adf1a74a7f7b |
12279 | 134 |
branch: foo |
135 |
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
|
136 |
parent: 1:6c0e42da283a |
12279 | 137 |
user: test |
138 |
date: Thu Jan 01 00:00:00 1970 +0000 |
|
139 |
summary: modify a branch |
|
140 |
||
141 |
$ cp .hg/bc-invalid $branchcache |
|
4175
fc12ac3755d5
Test update to branch tip
Brendan Cully <brendan@kublai.com>
parents:
4169
diff
changeset
|
142 |
|
12279 | 143 |
$ 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
|
144 |
changeset: 4:adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 |
12279 | 145 |
branch: foo |
146 |
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
|
147 |
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
|
148 |
parent: 1:6c0e42da283a56b5edc5b4fadb491365ec7f5fa8 |
12279 | 149 |
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
|
150 |
manifest: 1:8c342a37dfba0b3d3ce073562a00d8a813c54ffe |
12279 | 151 |
user: test |
152 |
date: Thu Jan 01 00:00:00 1970 +0000 |
|
153 |
files: a |
|
154 |
extra: branch=foo |
|
155 |
description: |
|
156 |
modify a branch |
|
157 |
||
158 |
||
18234
a55b06885cda
branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
18166
diff
changeset
|
159 |
$ purgebranchcaches |
12279 | 160 |
$ echo corrupted > $branchcache |
161 |
||
162 |
$ 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
|
163 |
4:adf1a74a7f7b |
12279 | 164 |
|
18234
a55b06885cda
branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
18166
diff
changeset
|
165 |
$ listbranchcaches |
20185
7d4219512823
branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents:
18382
diff
changeset
|
166 |
=== .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
|
167 |
corrupted |
20185
7d4219512823
branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents:
18382
diff
changeset
|
168 |
=== .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
|
169 |
adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4 |
20185
7d4219512823
branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents:
18382
diff
changeset
|
170 |
c21617b13b220988e7a2e26290fbe4325ffa7139 o bar |
7d4219512823
branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents:
18382
diff
changeset
|
171 |
1c28f494dae69a2f8fc815059d257eccf3fcfe75 o default |
7d4219512823
branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents:
18382
diff
changeset
|
172 |
adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 o foo |
12279 | 173 |
|
174 |
Push should update the branch cache: |
|
175 |
||
176 |
$ hg init ../target |
|
177 |
||
178 |
Pushing just rev 0: |
|
179 |
||
180 |
$ 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
|
181 |
|
18234
a55b06885cda
branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
18166
diff
changeset
|
182 |
$ (cd ../target/; listbranchcaches) |
20185
7d4219512823
branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents:
18382
diff
changeset
|
183 |
=== .hg/cache/branch2-base === |
12279 | 184 |
db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0 |
20185
7d4219512823
branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents:
18382
diff
changeset
|
185 |
db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 o default |
12279 | 186 |
|
187 |
Pushing everything: |
|
188 |
||
189 |
$ hg push -qf ../target |
|
190 |
||
18234
a55b06885cda
branchmap: allow to use cache of subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
18166
diff
changeset
|
191 |
$ (cd ../target/; listbranchcaches) |
20185
7d4219512823
branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents:
18382
diff
changeset
|
192 |
=== .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
|
193 |
adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4 |
20185
7d4219512823
branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents:
18382
diff
changeset
|
194 |
c21617b13b220988e7a2e26290fbe4325ffa7139 o bar |
7d4219512823
branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents:
18382
diff
changeset
|
195 |
1c28f494dae69a2f8fc815059d257eccf3fcfe75 o default |
7d4219512823
branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents:
18382
diff
changeset
|
196 |
adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 o foo |
12279 | 197 |
|
198 |
Update with no arguments: tipmost revision of the current branch: |
|
199 |
||
200 |
$ hg up -q -C 0 |
|
201 |
$ hg up -q |
|
202 |
$ 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
|
203 |
1c28f494dae6 |
12279 | 204 |
|
205 |
$ hg up -q 1 |
|
206 |
$ hg up -q |
|
207 |
$ 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
|
208 |
adf1a74a7f7b (foo) tip |
12279 | 209 |
|
210 |
$ hg branch foobar |
|
211 |
marked working directory as branch foobar |
|
212 |
||
213 |
$ hg up |
|
28903
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
214 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
12279 | 215 |
|
21024
7731a2281cf0
spelling: fixes from spell checker
Mads Kiilerich <madski@unity3d.com>
parents:
20185
diff
changeset
|
216 |
Fast-forward merge: |
12279 | 217 |
|
218 |
$ hg branch ff |
|
219 |
marked working directory as branch ff |
|
4231
83153299aab5
avoid a traceback with hg branch newbranch; hg up
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4179
diff
changeset
|
220 |
|
12279 | 221 |
$ echo ff > ff |
222 |
$ hg ci -Am'fast forward' |
|
223 |
adding ff |
|
224 |
||
225 |
$ hg up foo |
|
226 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
227 |
||
228 |
$ hg merge ff |
|
229 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
230 |
(branch merge, don't forget to commit) |
|
4410
bbc97d419b16
Add fast-forward branch merging
Brendan Cully <brendan@kublai.com>
parents:
4232
diff
changeset
|
231 |
|
12279 | 232 |
$ hg branch |
233 |
foo |
|
234 |
$ hg commit -m'Merge ff into foo' |
|
235 |
$ 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
|
236 |
changeset: 6:185ffbfefa30 |
12279 | 237 |
branch: foo |
238 |
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
|
239 |
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
|
240 |
parent: 5:1a3c27dc5e11 |
12279 | 241 |
user: test |
242 |
date: Thu Jan 01 00:00:00 1970 +0000 |
|
243 |
summary: Merge ff into foo |
|
244 |
||
245 |
$ hg manifest |
|
246 |
a |
|
247 |
ff |
|
248 |
||
249 |
||
250 |
Test merging, add 3 default heads and one test head: |
|
251 |
||
252 |
$ cd .. |
|
253 |
$ hg init merges |
|
254 |
$ cd merges |
|
255 |
$ echo a > a |
|
256 |
$ hg ci -Ama |
|
257 |
adding a |
|
258 |
||
259 |
$ echo b > b |
|
260 |
$ hg ci -Amb |
|
261 |
adding b |
|
6723
1fe6f365df2e
merge: only in-branch merges can be implicit
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6160
diff
changeset
|
262 |
|
12279 | 263 |
$ hg up 0 |
264 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
265 |
$ echo c > c |
|
266 |
$ hg ci -Amc |
|
267 |
adding c |
|
268 |
created new head |
|
6723
1fe6f365df2e
merge: only in-branch merges can be implicit
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6160
diff
changeset
|
269 |
|
12279 | 270 |
$ hg up 0 |
271 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
272 |
$ echo d > d |
|
273 |
$ hg ci -Amd |
|
274 |
adding d |
|
275 |
created new head |
|
6723
1fe6f365df2e
merge: only in-branch merges can be implicit
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6160
diff
changeset
|
276 |
|
12279 | 277 |
$ hg up 0 |
278 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
279 |
$ hg branch test |
|
280 |
marked working directory as branch test |
|
15615 | 281 |
(branches are permanent and global, did you want a bookmark?) |
12279 | 282 |
$ echo e >> e |
283 |
$ hg ci -Ame |
|
284 |
adding e |
|
6723
1fe6f365df2e
merge: only in-branch merges can be implicit
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6160
diff
changeset
|
285 |
|
12279 | 286 |
$ hg log |
287 |
changeset: 4:3a1e01ed1df4 |
|
288 |
branch: test |
|
289 |
tag: tip |
|
290 |
parent: 0:cb9a9f314b8b |
|
291 |
user: test |
|
292 |
date: Thu Jan 01 00:00:00 1970 +0000 |
|
293 |
summary: e |
|
294 |
||
295 |
changeset: 3:980f7dc84c29 |
|
296 |
parent: 0:cb9a9f314b8b |
|
297 |
user: test |
|
298 |
date: Thu Jan 01 00:00:00 1970 +0000 |
|
299 |
summary: d |
|
300 |
||
301 |
changeset: 2:d36c0562f908 |
|
302 |
parent: 0:cb9a9f314b8b |
|
303 |
user: test |
|
304 |
date: Thu Jan 01 00:00:00 1970 +0000 |
|
305 |
summary: c |
|
306 |
||
307 |
changeset: 1:d2ae7f538514 |
|
308 |
user: test |
|
309 |
date: Thu Jan 01 00:00:00 1970 +0000 |
|
310 |
summary: b |
|
311 |
||
312 |
changeset: 0:cb9a9f314b8b |
|
313 |
user: test |
|
314 |
date: Thu Jan 01 00:00:00 1970 +0000 |
|
315 |
summary: a |
|
316 |
||
317 |
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
|
318 |
|
12279 | 319 |
$ hg merge |
320 |
abort: branch 'test' has one head - please merge with an explicit rev |
|
321 |
(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
|
322 |
[255] |
12279 | 323 |
$ hg up -C default |
324 |
1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
325 |
||
326 |
Implicit merge with default branch as parent: |
|
327 |
||
328 |
$ hg merge |
|
329 |
abort: branch 'default' has 3 heads - please merge with an explicit rev |
|
330 |
(run 'hg heads .' to see heads) |
|
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
331 |
[255] |
12279 | 332 |
|
333 |
3 branch heads, explicit merge required: |
|
334 |
||
335 |
$ hg merge 2 |
|
336 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
337 |
(branch merge, don't forget to commit) |
|
338 |
$ hg ci -m merge |
|
339 |
||
340 |
2 branch heads, implicit merge works: |
|
341 |
||
342 |
$ hg merge |
|
343 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
344 |
(branch merge, don't forget to commit) |
|
345 |
||
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
15907
diff
changeset
|
346 |
$ cd .. |
28903
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
347 |
|
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
348 |
We expect that bare update on new branch, updates to parent |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
349 |
|
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
350 |
$ hg init bareupdateonnewbranch |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
351 |
$ cd bareupdateonnewbranch |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
352 |
$ hg update |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
353 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
354 |
$ touch a |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
355 |
$ hg commit -A -m "a" |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
356 |
adding a |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
357 |
$ touch b |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
358 |
$ hg commit -A -m "b" |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
359 |
adding b |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
360 |
$ touch c |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
361 |
$ hg commit -A -m "c" |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
362 |
adding c |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
363 |
$ hg update -r 1 |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
364 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
365 |
$ hg log -G |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
366 |
o changeset: 2:991a3460af53 |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
367 |
| tag: tip |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
368 |
| user: test |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
369 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
370 |
| summary: c |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
371 |
| |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
372 |
@ changeset: 1:0e067c57feba |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
373 |
| user: test |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
374 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
375 |
| summary: b |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
376 |
| |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
377 |
o changeset: 0:3903775176ed |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
378 |
user: test |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
379 |
date: Thu Jan 01 00:00:00 1970 +0000 |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
380 |
summary: a |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
381 |
|
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
382 |
$ hg branch dev |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
383 |
marked working directory as branch dev |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
384 |
(branches are permanent and global, did you want a bookmark?) |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
385 |
$ hg update |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
386 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
387 |
$ hg summary |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
388 |
parent: 1:0e067c57feba |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
389 |
b |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
390 |
branch: dev |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
391 |
commit: (new branch) |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
392 |
update: (current) |
e1dd0de26557
update: fix bare update to work on new branch
liscju <piotr.listkiewicz@gmail.com>
parents:
25295
diff
changeset
|
393 |
phases: 3 draft |
28924
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
394 |
|
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
395 |
$ cd .. |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
396 |
|
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
397 |
We need special handling for repositories with no "default" branch because |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
398 |
"null" revision belongs to non-existent "default" branch. |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
399 |
|
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
400 |
$ hg init nodefault |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
401 |
$ cd nodefault |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
402 |
$ hg branch -q foo |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
403 |
$ touch 0 |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
404 |
$ hg ci -Aqm0 |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
405 |
$ touch 1 |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
406 |
$ hg ci -Aqm1 |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
407 |
$ hg update -qr0 |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
408 |
$ hg branch -q bar |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
409 |
$ touch 2 |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
410 |
$ hg ci -Aqm2 |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
411 |
$ hg update -qr0 |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
412 |
$ hg branch -q baz |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
413 |
$ touch 3 |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
414 |
$ hg ci -Aqm3 |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
415 |
$ hg ci --close-branch -m 'close baz' |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
416 |
$ hg update -q null |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
417 |
$ hg log -GT'{rev} {branch}\n' |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
418 |
_ 4 baz |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
419 |
| |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
420 |
o 3 baz |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
421 |
| |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
422 |
| o 2 bar |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
423 |
|/ |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
424 |
| o 1 foo |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
425 |
|/ |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
426 |
o 0 foo |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
427 |
|
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
428 |
|
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
429 |
a) updating from "null" should bring us to the tip-most branch head as |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
430 |
there is no "default" branch: |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
431 |
|
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
432 |
$ hg update -q null |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
433 |
$ hg id -bn |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
434 |
-1 default |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
435 |
$ hg update |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
436 |
2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
437 |
$ hg id -bn |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
438 |
2 bar |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
439 |
|
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
440 |
b) but if we are at uncommitted "default" branch, we should stick to the |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
441 |
current revision: |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
442 |
|
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
443 |
$ hg update -q 0 |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
444 |
$ hg branch default |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
445 |
marked working directory as branch default |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
446 |
$ hg id -bn |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
447 |
0 default |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
448 |
$ hg update |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
449 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
450 |
$ hg id -bn |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
451 |
0 default |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
452 |
|
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
453 |
c) also, if we have uncommitted branch at "null", we should stick to it: |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
454 |
|
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
455 |
$ hg update -q null |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
456 |
$ hg branch new |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
457 |
marked working directory as branch new |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
458 |
$ hg id -bn |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
459 |
-1 new |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
460 |
$ hg update |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
461 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
462 |
$ hg id -bn |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
463 |
-1 new |
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
464 |
|
d9539959167d
update: resurrect bare update from null parent to tip-most branch head
Yuya Nishihara <yuya@tcha.org>
parents:
28903
diff
changeset
|
465 |
$ cd .. |
29284
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
466 |
|
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
467 |
We expect that update --clean discard changes in working directory, |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
468 |
and updates to the head of parent branch. |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
469 |
|
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
470 |
$ hg init updatebareclean |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
471 |
$ cd updatebareclean |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
472 |
$ hg update --clean |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
473 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
474 |
$ touch a |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
475 |
$ hg commit -A -m "a" |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
476 |
adding a |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
477 |
$ touch b |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
478 |
$ hg commit -A -m "b" |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
479 |
adding b |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
480 |
$ touch c |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
481 |
$ hg commit -A -m "c" |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
482 |
adding c |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
483 |
$ hg log |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
484 |
changeset: 2:991a3460af53 |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
485 |
tag: tip |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
486 |
user: test |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
487 |
date: Thu Jan 01 00:00:00 1970 +0000 |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
488 |
summary: c |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
489 |
|
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
490 |
changeset: 1:0e067c57feba |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
491 |
user: test |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
492 |
date: Thu Jan 01 00:00:00 1970 +0000 |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
493 |
summary: b |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
494 |
|
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
495 |
changeset: 0:3903775176ed |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
496 |
user: test |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
497 |
date: Thu Jan 01 00:00:00 1970 +0000 |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
498 |
summary: a |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
499 |
|
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
500 |
$ hg update -r 1 |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
501 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
502 |
$ hg branch new-branch |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
503 |
marked working directory as branch new-branch |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
504 |
(branches are permanent and global, did you want a bookmark?) |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
505 |
$ echo "aa" >> a |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
506 |
$ hg update --clean |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
507 |
2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
508 |
$ hg status |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
509 |
$ hg branch |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
510 |
default |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
511 |
$ hg parent |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
512 |
changeset: 2:991a3460af53 |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
513 |
tag: tip |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
514 |
user: test |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
515 |
date: Thu Jan 01 00:00:00 1970 +0000 |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
516 |
summary: c |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
517 |
|
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
518 |
We expect that update --clean on non existing parent discards a new branch |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
519 |
and updates to the tipmost non-closed branch head |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
520 |
|
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
521 |
$ hg update null |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
522 |
0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
523 |
$ hg branch newbranch |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
524 |
marked working directory as branch newbranch |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
525 |
(branches are permanent and global, did you want a bookmark?) |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
526 |
$ hg update -C |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
527 |
3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
528 |
$ hg summary |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
529 |
parent: 2:991a3460af53 tip |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
530 |
c |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
531 |
branch: default |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
532 |
commit: (clean) |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
533 |
update: (current) |
1c7167009936
update: fix bare --clean to work on new branch (issue5003) (BC)
liscju <piotr.listkiewicz@gmail.com>
parents:
28924
diff
changeset
|
534 |
phases: 3 draft |