Show More
@@ -1,432 +1,432 b'' | |||
|
1 | 1 | $ cat <<EOF > merge |
|
2 | 2 | > from __future__ import print_function |
|
3 | 3 | > import sys, os |
|
4 | 4 | > |
|
5 | 5 | > try: |
|
6 | 6 | > import msvcrt |
|
7 | 7 | > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) |
|
8 | 8 | > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) |
|
9 | 9 | > except ImportError: |
|
10 | 10 | > pass |
|
11 | 11 | > |
|
12 | 12 | > print("merging for", os.path.basename(sys.argv[1])) |
|
13 | 13 | > EOF |
|
14 | 14 | $ HGMERGE="$PYTHON ../merge"; export HGMERGE |
|
15 | 15 | |
|
16 | 16 | $ hg init t |
|
17 | 17 | $ cd t |
|
18 | 18 | $ echo This is file a1 > a |
|
19 | 19 | $ hg add a |
|
20 | 20 | $ hg commit -m "commit #0" |
|
21 | 21 | $ echo This is file b1 > b |
|
22 | 22 | $ hg add b |
|
23 | 23 | $ hg commit -m "commit #1" |
|
24 | 24 | |
|
25 | 25 | $ hg update 0 |
|
26 | 26 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
27 | 27 | |
|
28 | 28 | Test interrupted updates by having a non-empty dir with the same name as one |
|
29 | 29 | of the files in a commit we're updating to |
|
30 | 30 | |
|
31 | 31 | $ mkdir b && touch b/nonempty |
|
32 | 32 | $ hg up |
|
33 | abort: Unlinking directory not permitted: '$TESTTMP/t/b' (windows !) | |
|
34 | abort: Directory not empty: '$TESTTMP/t/b' (no-windows !) | |
|
33 | abort: Unlinking directory not permitted: '?\$TESTTMP/t/b'? (re) (windows !) | |
|
34 | abort: Directory not empty: '?\$TESTTMP/t/b'? (re) (no-windows !) | |
|
35 | 35 | [255] |
|
36 | 36 | $ hg ci |
|
37 | 37 | abort: last update was interrupted |
|
38 | 38 | (use 'hg update' to get a consistent checkout) |
|
39 | 39 | [255] |
|
40 | 40 | $ hg sum |
|
41 | 41 | parent: 0:538afb845929 |
|
42 | 42 | commit #0 |
|
43 | 43 | branch: default |
|
44 | 44 | commit: 1 unknown (interrupted update) |
|
45 | 45 | update: 1 new changesets (update) |
|
46 | 46 | phases: 2 draft |
|
47 | 47 | |
|
48 | 48 | $ rm b/nonempty |
|
49 | 49 | |
|
50 | 50 | $ hg up |
|
51 | 51 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
52 | 52 | $ hg sum |
|
53 | 53 | parent: 1:b8bb4a988f25 tip |
|
54 | 54 | commit #1 |
|
55 | 55 | branch: default |
|
56 | 56 | commit: (clean) |
|
57 | 57 | update: (current) |
|
58 | 58 | phases: 2 draft |
|
59 | 59 | |
|
60 | 60 | Prepare a basic merge |
|
61 | 61 | |
|
62 | 62 | $ hg up 0 |
|
63 | 63 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
64 | 64 | $ echo This is file c1 > c |
|
65 | 65 | $ hg add c |
|
66 | 66 | $ hg commit -m "commit #2" |
|
67 | 67 | created new head |
|
68 | 68 | $ echo This is file b1 > b |
|
69 | 69 | no merges expected |
|
70 | 70 | $ hg merge -P 1 |
|
71 | 71 | changeset: 1:b8bb4a988f25 |
|
72 | 72 | user: test |
|
73 | 73 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
74 | 74 | summary: commit #1 |
|
75 | 75 | |
|
76 | 76 | $ hg merge 1 |
|
77 | 77 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
78 | 78 | (branch merge, don't forget to commit) |
|
79 | 79 | $ hg diff --nodates |
|
80 | 80 | diff -r 49035e18a8e6 b |
|
81 | 81 | --- /dev/null |
|
82 | 82 | +++ b/b |
|
83 | 83 | @@ -0,0 +1,1 @@ |
|
84 | 84 | +This is file b1 |
|
85 | 85 | $ hg status |
|
86 | 86 | M b |
|
87 | 87 | $ cd ..; rm -r t |
|
88 | 88 | |
|
89 | 89 | $ hg init t |
|
90 | 90 | $ cd t |
|
91 | 91 | $ echo This is file a1 > a |
|
92 | 92 | $ hg add a |
|
93 | 93 | $ hg commit -m "commit #0" |
|
94 | 94 | $ echo This is file b1 > b |
|
95 | 95 | $ hg add b |
|
96 | 96 | $ hg commit -m "commit #1" |
|
97 | 97 | |
|
98 | 98 | $ hg update 0 |
|
99 | 99 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
100 | 100 | $ echo This is file c1 > c |
|
101 | 101 | $ hg add c |
|
102 | 102 | $ hg commit -m "commit #2" |
|
103 | 103 | created new head |
|
104 | 104 | $ echo This is file b2 > b |
|
105 | 105 | merge should fail |
|
106 | 106 | $ hg merge 1 |
|
107 | 107 | b: untracked file differs |
|
108 | 108 | abort: untracked files in working directory differ from files in requested revision |
|
109 | 109 | [255] |
|
110 | 110 | |
|
111 | 111 | #if symlink |
|
112 | 112 | symlinks to directories should be treated as regular files (issue5027) |
|
113 | 113 | $ rm b |
|
114 | 114 | $ ln -s 'This is file b2' b |
|
115 | 115 | $ hg merge 1 |
|
116 | 116 | b: untracked file differs |
|
117 | 117 | abort: untracked files in working directory differ from files in requested revision |
|
118 | 118 | [255] |
|
119 | 119 | symlinks shouldn't be followed |
|
120 | 120 | $ rm b |
|
121 | 121 | $ echo This is file b1 > .hg/b |
|
122 | 122 | $ ln -s .hg/b b |
|
123 | 123 | $ hg merge 1 |
|
124 | 124 | b: untracked file differs |
|
125 | 125 | abort: untracked files in working directory differ from files in requested revision |
|
126 | 126 | [255] |
|
127 | 127 | |
|
128 | 128 | $ rm b |
|
129 | 129 | $ echo This is file b2 > b |
|
130 | 130 | #endif |
|
131 | 131 | |
|
132 | 132 | bad config |
|
133 | 133 | $ hg merge 1 --config merge.checkunknown=x |
|
134 | 134 | abort: merge.checkunknown not valid ('x' is none of 'abort', 'ignore', 'warn') |
|
135 | 135 | [255] |
|
136 | 136 | this merge should fail |
|
137 | 137 | $ hg merge 1 --config merge.checkunknown=abort |
|
138 | 138 | b: untracked file differs |
|
139 | 139 | abort: untracked files in working directory differ from files in requested revision |
|
140 | 140 | [255] |
|
141 | 141 | |
|
142 | 142 | this merge should warn |
|
143 | 143 | $ hg merge 1 --config merge.checkunknown=warn |
|
144 | 144 | b: replacing untracked file |
|
145 | 145 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
146 | 146 | (branch merge, don't forget to commit) |
|
147 | 147 | $ cat b.orig |
|
148 | 148 | This is file b2 |
|
149 | 149 | $ hg up --clean 2 |
|
150 | 150 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
151 | 151 | $ mv b.orig b |
|
152 | 152 | |
|
153 | 153 | this merge should silently ignore |
|
154 | 154 | $ cat b |
|
155 | 155 | This is file b2 |
|
156 | 156 | $ hg merge 1 --config merge.checkunknown=ignore |
|
157 | 157 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
158 | 158 | (branch merge, don't forget to commit) |
|
159 | 159 | |
|
160 | 160 | merge.checkignored |
|
161 | 161 | $ hg up --clean 1 |
|
162 | 162 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
163 | 163 | $ cat >> .hgignore << EOF |
|
164 | 164 | > remoteignored |
|
165 | 165 | > EOF |
|
166 | 166 | $ echo This is file localignored3 > localignored |
|
167 | 167 | $ echo This is file remoteignored3 > remoteignored |
|
168 | 168 | $ hg add .hgignore localignored remoteignored |
|
169 | 169 | $ hg commit -m "commit #3" |
|
170 | 170 | |
|
171 | 171 | $ hg up 2 |
|
172 | 172 | 1 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
173 | 173 | $ cat >> .hgignore << EOF |
|
174 | 174 | > localignored |
|
175 | 175 | > EOF |
|
176 | 176 | $ hg add .hgignore |
|
177 | 177 | $ hg commit -m "commit #4" |
|
178 | 178 | |
|
179 | 179 | remote .hgignore shouldn't be used for determining whether a file is ignored |
|
180 | 180 | $ echo This is file remoteignored4 > remoteignored |
|
181 | 181 | $ hg merge 3 --config merge.checkignored=ignore --config merge.checkunknown=abort |
|
182 | 182 | remoteignored: untracked file differs |
|
183 | 183 | abort: untracked files in working directory differ from files in requested revision |
|
184 | 184 | [255] |
|
185 | 185 | $ hg merge 3 --config merge.checkignored=abort --config merge.checkunknown=ignore |
|
186 | 186 | merging .hgignore |
|
187 | 187 | merging for .hgignore |
|
188 | 188 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
189 | 189 | (branch merge, don't forget to commit) |
|
190 | 190 | $ cat remoteignored |
|
191 | 191 | This is file remoteignored3 |
|
192 | 192 | $ cat remoteignored.orig |
|
193 | 193 | This is file remoteignored4 |
|
194 | 194 | $ rm remoteignored.orig |
|
195 | 195 | |
|
196 | 196 | local .hgignore should be used for that |
|
197 | 197 | $ hg up --clean 4 |
|
198 | 198 | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
199 | 199 | $ echo This is file localignored4 > localignored |
|
200 | 200 | also test other conflicting files to see we output the full set of warnings |
|
201 | 201 | $ echo This is file b2 > b |
|
202 | 202 | $ hg merge 3 --config merge.checkignored=abort --config merge.checkunknown=abort |
|
203 | 203 | b: untracked file differs |
|
204 | 204 | localignored: untracked file differs |
|
205 | 205 | abort: untracked files in working directory differ from files in requested revision |
|
206 | 206 | [255] |
|
207 | 207 | $ hg merge 3 --config merge.checkignored=abort --config merge.checkunknown=ignore |
|
208 | 208 | localignored: untracked file differs |
|
209 | 209 | abort: untracked files in working directory differ from files in requested revision |
|
210 | 210 | [255] |
|
211 | 211 | $ hg merge 3 --config merge.checkignored=warn --config merge.checkunknown=abort |
|
212 | 212 | b: untracked file differs |
|
213 | 213 | abort: untracked files in working directory differ from files in requested revision |
|
214 | 214 | [255] |
|
215 | 215 | $ hg merge 3 --config merge.checkignored=warn --config merge.checkunknown=warn |
|
216 | 216 | b: replacing untracked file |
|
217 | 217 | localignored: replacing untracked file |
|
218 | 218 | merging .hgignore |
|
219 | 219 | merging for .hgignore |
|
220 | 220 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
221 | 221 | (branch merge, don't forget to commit) |
|
222 | 222 | $ cat localignored |
|
223 | 223 | This is file localignored3 |
|
224 | 224 | $ cat localignored.orig |
|
225 | 225 | This is file localignored4 |
|
226 | 226 | $ rm localignored.orig |
|
227 | 227 | |
|
228 | 228 | $ cat b.orig |
|
229 | 229 | This is file b2 |
|
230 | 230 | $ hg up --clean 2 |
|
231 | 231 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
232 | 232 | $ mv b.orig b |
|
233 | 233 | |
|
234 | 234 | this merge of b should work |
|
235 | 235 | $ cat b |
|
236 | 236 | This is file b2 |
|
237 | 237 | $ hg merge -f 1 |
|
238 | 238 | merging b |
|
239 | 239 | merging for b |
|
240 | 240 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
241 | 241 | (branch merge, don't forget to commit) |
|
242 | 242 | $ hg diff --nodates |
|
243 | 243 | diff -r 49035e18a8e6 b |
|
244 | 244 | --- /dev/null |
|
245 | 245 | +++ b/b |
|
246 | 246 | @@ -0,0 +1,1 @@ |
|
247 | 247 | +This is file b2 |
|
248 | 248 | $ hg status |
|
249 | 249 | M b |
|
250 | 250 | $ cd ..; rm -r t |
|
251 | 251 | |
|
252 | 252 | $ hg init t |
|
253 | 253 | $ cd t |
|
254 | 254 | $ echo This is file a1 > a |
|
255 | 255 | $ hg add a |
|
256 | 256 | $ hg commit -m "commit #0" |
|
257 | 257 | $ echo This is file b1 > b |
|
258 | 258 | $ hg add b |
|
259 | 259 | $ hg commit -m "commit #1" |
|
260 | 260 | $ echo This is file b22 > b |
|
261 | 261 | $ hg commit -m "commit #2" |
|
262 | 262 | $ hg update 1 |
|
263 | 263 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
264 | 264 | $ echo This is file c1 > c |
|
265 | 265 | $ hg add c |
|
266 | 266 | $ hg commit -m "commit #3" |
|
267 | 267 | created new head |
|
268 | 268 | |
|
269 | 269 | Contents of b should be "this is file b1" |
|
270 | 270 | $ cat b |
|
271 | 271 | This is file b1 |
|
272 | 272 | |
|
273 | 273 | $ echo This is file b22 > b |
|
274 | 274 | merge fails |
|
275 | 275 | $ hg merge 2 |
|
276 | 276 | abort: uncommitted changes |
|
277 | 277 | (use 'hg status' to list changes) |
|
278 | 278 | [255] |
|
279 | 279 | merge expected! |
|
280 | 280 | $ hg merge -f 2 |
|
281 | 281 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
282 | 282 | (branch merge, don't forget to commit) |
|
283 | 283 | $ hg diff --nodates |
|
284 | 284 | diff -r 85de557015a8 b |
|
285 | 285 | --- a/b |
|
286 | 286 | +++ b/b |
|
287 | 287 | @@ -1,1 +1,1 @@ |
|
288 | 288 | -This is file b1 |
|
289 | 289 | +This is file b22 |
|
290 | 290 | $ hg status |
|
291 | 291 | M b |
|
292 | 292 | $ cd ..; rm -r t |
|
293 | 293 | |
|
294 | 294 | $ hg init t |
|
295 | 295 | $ cd t |
|
296 | 296 | $ echo This is file a1 > a |
|
297 | 297 | $ hg add a |
|
298 | 298 | $ hg commit -m "commit #0" |
|
299 | 299 | $ echo This is file b1 > b |
|
300 | 300 | $ hg add b |
|
301 | 301 | $ hg commit -m "commit #1" |
|
302 | 302 | $ echo This is file b22 > b |
|
303 | 303 | $ hg commit -m "commit #2" |
|
304 | 304 | $ hg update 1 |
|
305 | 305 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
306 | 306 | $ echo This is file c1 > c |
|
307 | 307 | $ hg add c |
|
308 | 308 | $ hg commit -m "commit #3" |
|
309 | 309 | created new head |
|
310 | 310 | $ echo This is file b33 > b |
|
311 | 311 | merge of b should fail |
|
312 | 312 | $ hg merge 2 |
|
313 | 313 | abort: uncommitted changes |
|
314 | 314 | (use 'hg status' to list changes) |
|
315 | 315 | [255] |
|
316 | 316 | merge of b expected |
|
317 | 317 | $ hg merge -f 2 |
|
318 | 318 | merging b |
|
319 | 319 | merging for b |
|
320 | 320 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
321 | 321 | (branch merge, don't forget to commit) |
|
322 | 322 | $ hg diff --nodates |
|
323 | 323 | diff -r 85de557015a8 b |
|
324 | 324 | --- a/b |
|
325 | 325 | +++ b/b |
|
326 | 326 | @@ -1,1 +1,1 @@ |
|
327 | 327 | -This is file b1 |
|
328 | 328 | +This is file b33 |
|
329 | 329 | $ hg status |
|
330 | 330 | M b |
|
331 | 331 | |
|
332 | 332 | Test for issue2364 |
|
333 | 333 | |
|
334 | 334 | $ hg up -qC . |
|
335 | 335 | $ hg rm b |
|
336 | 336 | $ hg ci -md |
|
337 | 337 | $ hg revert -r -2 b |
|
338 | 338 | $ hg up -q -- -2 |
|
339 | 339 | |
|
340 | 340 | Test that updated files are treated as "modified", when |
|
341 | 341 | 'merge.update()' is aborted before 'merge.recordupdates()' (= parents |
|
342 | 342 | aren't changed), even if none of mode, size and timestamp of them |
|
343 | 343 | isn't changed on the filesystem (see also issue4583). |
|
344 | 344 | |
|
345 | 345 | $ cat > $TESTTMP/abort.py <<EOF |
|
346 | 346 | > from __future__ import absolute_import |
|
347 | 347 | > # emulate aborting before "recordupdates()". in this case, files |
|
348 | 348 | > # are changed without updating dirstate |
|
349 | 349 | > from mercurial import ( |
|
350 | 350 | > error, |
|
351 | 351 | > extensions, |
|
352 | 352 | > merge, |
|
353 | 353 | > ) |
|
354 | 354 | > def applyupdates(orig, *args, **kwargs): |
|
355 | 355 | > orig(*args, **kwargs) |
|
356 | 356 | > raise error.Abort('intentional aborting') |
|
357 | 357 | > def extsetup(ui): |
|
358 | 358 | > extensions.wrapfunction(merge, "applyupdates", applyupdates) |
|
359 | 359 | > EOF |
|
360 | 360 | |
|
361 | 361 | $ cat >> .hg/hgrc <<EOF |
|
362 | 362 | > [fakedirstatewritetime] |
|
363 | 363 | > # emulate invoking dirstate.write() via repo.status() |
|
364 | 364 | > # at 2000-01-01 00:00 |
|
365 | 365 | > fakenow = 200001010000 |
|
366 | 366 | > EOF |
|
367 | 367 | |
|
368 | 368 | (file gotten from other revision) |
|
369 | 369 | |
|
370 | 370 | $ hg update -q -C 2 |
|
371 | 371 | $ echo 'THIS IS FILE B5' > b |
|
372 | 372 | $ hg commit -m 'commit #5' |
|
373 | 373 | |
|
374 | 374 | $ hg update -q -C 3 |
|
375 | 375 | $ cat b |
|
376 | 376 | This is file b1 |
|
377 | 377 | $ touch -t 200001010000 b |
|
378 | 378 | $ hg debugrebuildstate |
|
379 | 379 | |
|
380 | 380 | $ cat >> .hg/hgrc <<EOF |
|
381 | 381 | > [extensions] |
|
382 | 382 | > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py |
|
383 | 383 | > abort = $TESTTMP/abort.py |
|
384 | 384 | > EOF |
|
385 | 385 | $ hg merge 5 |
|
386 | 386 | abort: intentional aborting |
|
387 | 387 | [255] |
|
388 | 388 | $ cat >> .hg/hgrc <<EOF |
|
389 | 389 | > [extensions] |
|
390 | 390 | > fakedirstatewritetime = ! |
|
391 | 391 | > abort = ! |
|
392 | 392 | > EOF |
|
393 | 393 | |
|
394 | 394 | $ cat b |
|
395 | 395 | THIS IS FILE B5 |
|
396 | 396 | $ touch -t 200001010000 b |
|
397 | 397 | $ hg status -A b |
|
398 | 398 | M b |
|
399 | 399 | |
|
400 | 400 | (file merged from other revision) |
|
401 | 401 | |
|
402 | 402 | $ hg update -q -C 3 |
|
403 | 403 | $ echo 'this is file b6' > b |
|
404 | 404 | $ hg commit -m 'commit #6' |
|
405 | 405 | created new head |
|
406 | 406 | |
|
407 | 407 | $ cat b |
|
408 | 408 | this is file b6 |
|
409 | 409 | $ touch -t 200001010000 b |
|
410 | 410 | $ hg debugrebuildstate |
|
411 | 411 | |
|
412 | 412 | $ cat >> .hg/hgrc <<EOF |
|
413 | 413 | > [extensions] |
|
414 | 414 | > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py |
|
415 | 415 | > abort = $TESTTMP/abort.py |
|
416 | 416 | > EOF |
|
417 | 417 | $ hg merge --tool internal:other 5 |
|
418 | 418 | abort: intentional aborting |
|
419 | 419 | [255] |
|
420 | 420 | $ cat >> .hg/hgrc <<EOF |
|
421 | 421 | > [extensions] |
|
422 | 422 | > fakedirstatewritetime = ! |
|
423 | 423 | > abort = ! |
|
424 | 424 | > EOF |
|
425 | 425 | |
|
426 | 426 | $ cat b |
|
427 | 427 | THIS IS FILE B5 |
|
428 | 428 | $ touch -t 200001010000 b |
|
429 | 429 | $ hg status -A b |
|
430 | 430 | M b |
|
431 | 431 | |
|
432 | 432 | $ cd .. |
@@ -1,93 +1,93 b'' | |||
|
1 | 1 | Test update logic when there are renames or weird same-name cases between dirs |
|
2 | 2 | and files |
|
3 | 3 | |
|
4 | 4 | Update with local changes across a file rename |
|
5 | 5 | |
|
6 | 6 | $ hg init r1 && cd r1 |
|
7 | 7 | |
|
8 | 8 | $ echo a > a |
|
9 | 9 | $ hg add a |
|
10 | 10 | $ hg ci -m a |
|
11 | 11 | |
|
12 | 12 | $ hg mv a b |
|
13 | 13 | $ hg ci -m rename |
|
14 | 14 | |
|
15 | 15 | $ echo b > b |
|
16 | 16 | $ hg ci -m change |
|
17 | 17 | |
|
18 | 18 | $ hg up -q 0 |
|
19 | 19 | |
|
20 | 20 | $ echo c > a |
|
21 | 21 | |
|
22 | 22 | $ hg up |
|
23 | 23 | merging a and b to b |
|
24 | 24 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
|
25 | 25 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
26 | 26 | use 'hg resolve' to retry unresolved file merges |
|
27 | 27 | [1] |
|
28 | 28 | |
|
29 | 29 | Test update when local untracked directory exists with the same name as a |
|
30 | 30 | tracked file in a commit we are updating to |
|
31 | 31 | $ hg init r2 && cd r2 |
|
32 | 32 | $ echo root > root && hg ci -Am root # rev 0 |
|
33 | 33 | adding root |
|
34 | 34 | $ echo text > name && hg ci -Am "name is a file" # rev 1 |
|
35 | 35 | adding name |
|
36 | 36 | $ hg up 0 |
|
37 | 37 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
38 | 38 | $ mkdir name |
|
39 | 39 | $ hg up 1 |
|
40 | 40 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
41 | 41 | |
|
42 | 42 | Test update when local untracked directory exists with some files in it and has |
|
43 | 43 | the same name a tracked file in a commit we are updating to. In future this |
|
44 | 44 | should be updated to give an friendlier error message, but now we should just |
|
45 | 45 | make sure that this does not erase untracked data |
|
46 | 46 | $ hg up 0 |
|
47 | 47 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
48 | 48 | $ mkdir name |
|
49 | 49 | $ echo text > name/file |
|
50 | 50 | $ hg st |
|
51 | 51 | ? name/file |
|
52 | 52 | $ hg up 1 |
|
53 | abort: Unlinking directory not permitted: '$TESTTMP/r1/r2/name' (windows !) | |
|
54 | abort: Directory not empty: '$TESTTMP/r1/r2/name' (no-windows !) | |
|
53 | abort: Unlinking directory not permitted: '?$TESTTMP/r1/r2/name'? (re) (windows !) | |
|
54 | abort: Directory not empty: '?\$TESTTMP/r1/r2/name'? (re) (no-windows !) | |
|
55 | 55 | [255] |
|
56 | 56 | $ cat name/file |
|
57 | 57 | text |
|
58 | 58 | $ cd .. |
|
59 | 59 | |
|
60 | 60 | #if symlink |
|
61 | 61 | |
|
62 | 62 | Test update when two commits have symlinks that point to different folders |
|
63 | 63 | $ hg init r3 && cd r3 |
|
64 | 64 | $ echo root > root && hg ci -Am root |
|
65 | 65 | adding root |
|
66 | 66 | $ mkdir folder1 && mkdir folder2 |
|
67 | 67 | $ ln -s folder1 folder |
|
68 | 68 | $ hg ci -Am "symlink to folder1" |
|
69 | 69 | adding folder |
|
70 | 70 | $ rm folder |
|
71 | 71 | $ ln -s folder2 folder |
|
72 | 72 | $ hg ci -Am "symlink to folder2" |
|
73 | 73 | $ hg up 1 |
|
74 | 74 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
75 | 75 | $ cd .. |
|
76 | 76 | |
|
77 | 77 | #endif |
|
78 | 78 | |
|
79 | 79 | #if rmcwd |
|
80 | 80 | |
|
81 | 81 | Test that warning is printed if cwd is deleted during update |
|
82 | 82 | $ hg init r4 && cd r4 |
|
83 | 83 | $ mkdir dir |
|
84 | 84 | $ cd dir |
|
85 | 85 | $ echo a > a |
|
86 | 86 | $ echo b > b |
|
87 | 87 | $ hg add a b |
|
88 | 88 | $ hg ci -m "file and dir" |
|
89 | 89 | $ hg up -q null |
|
90 | 90 | current directory was removed |
|
91 | 91 | (consider changing to repo root: $TESTTMP/r1/r4) |
|
92 | 92 | |
|
93 | 93 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now