Debian Codegraph @

tests/test-pull-update.t

raw
1 $ hg init t
2 $ cd t
3 $ echo 1 > foo
4 $ hg ci -Am m
5 adding foo
6
7 $ cd ..
8 $ hg clone t tt
9 updating to branch default
10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
11 $ cd tt
12 $ echo 1.1 > foo
13 $ hg ci -Am m
14
15 $ cd ../t
16 $ echo 1.2 > foo
17 $ hg ci -Am m
18
19 Should respect config to disable dirty update
20 $ hg co -qC 0
21 $ echo 2 > foo
22 $ hg --config commands.update.check=abort pull -u ../tt
23 pulling from ../tt
24 searching for changes
25 adding changesets
26 adding manifests
27 adding file changes
28 added 1 changesets with 1 changes to 1 files (+1 heads)
29 new changesets 107cefe13e42
30 1 local changesets published
31 abort: uncommitted changes
32 [20]
33 $ hg --config extensions.strip= strip --no-backup tip
34 $ hg co -qC tip
35
36 Should not update to the other topological branch:
37
38 $ hg pull -u ../tt
39 pulling from ../tt
40 searching for changes
41 adding changesets
42 adding manifests
43 adding file changes
44 added 1 changesets with 1 changes to 1 files (+1 heads)
45 new changesets 107cefe13e42
46 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 updated to "800c91d5bfc1: m"
48 1 other heads for branch "default"
49
50 $ cd ../tt
51
52 Should not update to the other branch:
53
54 $ hg pull -u ../t
55 pulling from ../t
56 searching for changes
57 adding changesets
58 adding manifests
59 adding file changes
60 added 1 changesets with 1 changes to 1 files (+1 heads)
61 new changesets 800c91d5bfc1
62 1 local changesets published
63 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 updated to "107cefe13e42: m"
65 1 other heads for branch "default"
66
67 $ HGMERGE=true hg merge
68 merging foo
69 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
70 (branch merge, don't forget to commit)
71 $ hg ci -mm
72
73 $ cd ../t
74
75 Should work:
76
77 $ hg pull -u ../tt
78 pulling from ../tt
79 searching for changes
80 adding changesets
81 adding manifests
82 adding file changes
83 added 1 changesets with 1 changes to 1 files (-1 heads)
84 new changesets 483b76ad4309
85 1 local changesets published
86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
87
88 Similarity between "hg update" and "hg pull -u" in handling bookmark
89 ====================================================================
90
91 Test that updating activates the bookmark, which matches with the
92 explicit destination of the update.
93
94 $ echo 4 >> foo
95 $ hg commit -m "#4"
96 $ hg bookmark active-after-pull
97 $ cd ../tt
98
99 (1) activating by --rev BOOKMARK
100
101 $ hg bookmark -f active-before-pull
102 $ hg bookmarks
103 * active-before-pull 3:483b76ad4309
104
105 $ hg pull -u -r active-after-pull
106 pulling from $TESTTMP/t
107 searching for changes
108 adding changesets
109 adding manifests
110 adding file changes
111 adding remote bookmark active-after-pull
112 added 1 changesets with 1 changes to 1 files
113 new changesets f815b3da6163
114 1 local changesets published
115 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
116 (activating bookmark active-after-pull)
117
118 $ hg parents -q
119 4:f815b3da6163
120 $ hg bookmarks
121 * active-after-pull 4:f815b3da6163
122 active-before-pull 3:483b76ad4309
123
124 (discard pulled changes)
125
126 $ hg update -q 483b76ad4309
127 $ hg rollback -q
128
129 (2) activating by URL#BOOKMARK
130
131 $ hg bookmark -f active-before-pull
132 $ hg bookmarks
133 * active-before-pull 3:483b76ad4309
134
135 $ hg pull -u $TESTTMP/t#active-after-pull
136 pulling from $TESTTMP/t
137 searching for changes
138 adding changesets
139 adding manifests
140 adding file changes
141 adding remote bookmark active-after-pull
142 added 1 changesets with 1 changes to 1 files
143 new changesets f815b3da6163
144 1 local changesets published
145 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 (activating bookmark active-after-pull)
147
148 $ hg parents -q
149 4:f815b3da6163
150 $ hg bookmarks
151 * active-after-pull 4:f815b3da6163
152 active-before-pull 3:483b76ad4309
153
154 (discard pulled changes)
155
156 $ hg update -q 483b76ad4309
157 $ hg rollback -q
158
159 Test that updating deactivates current active bookmark, if the
160 destination of the update is explicitly specified, and it doesn't
161 match with the name of any existing bookmarks.
162
163 $ cd ../t
164 $ hg bookmark -d active-after-pull
165 $ hg branch bar -q
166 $ hg commit -m "#5 (bar #1)"
167 $ cd ../tt
168
169 (1) deactivating by --rev REV
170
171 $ hg bookmark -f active-before-pull
172 $ hg bookmarks
173 * active-before-pull 3:483b76ad4309
174
175 $ hg pull -u -r b5e4babfaaa7
176 pulling from $TESTTMP/t
177 searching for changes
178 adding changesets
179 adding manifests
180 adding file changes
181 added 2 changesets with 1 changes to 1 files
182 new changesets f815b3da6163:b5e4babfaaa7
183 1 local changesets published
184 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
185 (leaving bookmark active-before-pull)
186
187 $ hg parents -q
188 5:b5e4babfaaa7
189 $ hg bookmarks
190 active-before-pull 3:483b76ad4309
191
192 (discard pulled changes)
193
194 $ hg update -q 483b76ad4309
195 $ hg rollback -q
196
197 (2) deactivating by --branch BRANCH
198
199 $ hg bookmark -f active-before-pull
200 $ hg bookmarks
201 * active-before-pull 3:483b76ad4309
202
203 $ hg pull -u -b bar
204 pulling from $TESTTMP/t
205 searching for changes
206 adding changesets
207 adding manifests
208 adding file changes
209 added 2 changesets with 1 changes to 1 files
210 new changesets f815b3da6163:b5e4babfaaa7
211 1 local changesets published
212 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
213 (leaving bookmark active-before-pull)
214
215 $ hg parents -q
216 5:b5e4babfaaa7
217 $ hg bookmarks
218 active-before-pull 3:483b76ad4309
219
220 (discard pulled changes)
221
222 $ hg update -q 483b76ad4309
223 $ hg rollback -q
224
225 (3) deactivating by URL#ANOTHER-BRANCH
226
227 $ hg bookmark -f active-before-pull
228 $ hg bookmarks
229 * active-before-pull 3:483b76ad4309
230
231 $ hg pull -u $TESTTMP/t#bar
232 pulling from $TESTTMP/t
233 searching for changes
234 adding changesets
235 adding manifests
236 adding file changes
237 added 2 changesets with 1 changes to 1 files
238 new changesets f815b3da6163:b5e4babfaaa7
239 1 local changesets published
240 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
241 (leaving bookmark active-before-pull)
242
243 $ hg parents -q
244 5:b5e4babfaaa7
245 $ hg bookmarks
246 active-before-pull 3:483b76ad4309
247
248 $ cd ..
249
250 Issue622: hg init && hg pull -u URL doesn't checkout default branch
251
252 $ hg init test
253 $ cd test
254 $ echo foo>foo
255 $ hg addremove
256 adding foo
257 $ hg commit -m 1
258 $ cd ..
259
260 $ hg init empty
261 $ cd empty
262 $ hg pull -u ../test
263 pulling from ../test
264 requesting all changes
265 adding changesets
266 adding manifests
267 adding file changes
268 added 1 changesets with 1 changes to 1 files
269 new changesets 340e38bdcde4
270 1 files updated, 0 files merged, 0 files removed, 0 files unresolved