Mercurial > hg
annotate tests/test-pathconflicts-basic.t @ 34569:e304fd82c718
tests: use readlink.py instead of readlink
The latter doesn't always exist, such as on Solaris-derived platforms.
Differential Revision: https://phab.mercurial-scm.org/D996
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 10 Oct 2017 11:02:23 -0400 |
parents | 7a8a16f8ea22 |
children | 2a774cae3a03 |
rev | line source |
---|---|
34544
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
1 $ hg init repo |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
2 $ cd repo |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
3 $ echo base > base |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
4 $ hg add base |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
5 $ hg commit -m "base" |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
6 $ hg bookmark -i base |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
7 $ echo 1 > a |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
8 $ hg add a |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
9 $ hg commit -m "file" |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
10 $ hg bookmark -i file |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
11 $ echo 2 > a |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
12 $ hg commit -m "file2" |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
13 $ hg bookmark -i file2 |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
14 $ hg up -q 0 |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
15 $ mkdir a |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
16 $ echo 2 > a/b |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
17 $ hg add a/b |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
18 $ hg commit -m "dir" |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
19 created new head |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
20 $ hg bookmark -i dir |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
21 |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
22 Basic merge - local file conflicts with remote directory |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
23 |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
24 $ hg up -q file |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
25 $ hg bookmark -i |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
26 $ hg merge --verbose dir |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
27 resolving manifests |
34555
989e884d1be9
merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents:
34553
diff
changeset
|
28 a: path conflict - a file or link has the same name as a directory |
989e884d1be9
merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents:
34553
diff
changeset
|
29 the local file has been renamed to a~853701544ac3 |
989e884d1be9
merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents:
34553
diff
changeset
|
30 resolve manually then use 'hg resolve --mark a' |
989e884d1be9
merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents:
34553
diff
changeset
|
31 moving a to a~853701544ac3 |
34544
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
32 getting a/b |
34555
989e884d1be9
merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents:
34553
diff
changeset
|
33 1 files updated, 0 files merged, 0 files removed, 1 files unresolved |
989e884d1be9
merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents:
34553
diff
changeset
|
34 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
989e884d1be9
merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents:
34553
diff
changeset
|
35 [1] |
34544
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
36 $ hg update --clean . |
34555
989e884d1be9
merge: check for path conflicts when merging (issue5628)
Mark Thomas <mbthomas@fb.com>
parents:
34553
diff
changeset
|
37 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
34556
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
38 $ rm a~853701544ac3 |
34544
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
39 |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
40 Basic update - local directory conflicts with remote file |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
41 |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
42 $ hg up -q 0 |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
43 $ mkdir a |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
44 $ echo 3 > a/b |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
45 $ hg up file |
34553
0217d66846f7
merge: improve error messages for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
34552
diff
changeset
|
46 a: untracked directory conflicts with file |
34552
33c8a6837181
merge: check for path conflicts when updating (issue5628)
Mark Thomas <mbthomas@fb.com>
parents:
34544
diff
changeset
|
47 abort: untracked files in working directory differ from files in requested revision |
34544
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
48 [255] |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
49 $ hg up --clean file |
34556
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
51 (activating bookmark file) |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
52 |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
53 Repo state is ok |
34544
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
54 |
34556
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
55 $ hg sum |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
56 parent: 1:853701544ac3 |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
57 file |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
58 branch: default |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
59 bookmarks: *file |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
60 commit: (clean) |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
61 update: 2 new changesets (update) |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
62 phases: 4 draft |
34544
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
63 |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
64 Basic update - untracked file conflicts with remote directory |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
65 |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
66 $ hg up -q 0 |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
67 $ echo untracked > a |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
68 $ hg up --config merge.checkunknown=warn dir |
34552
33c8a6837181
merge: check for path conflicts when updating (issue5628)
Mark Thomas <mbthomas@fb.com>
parents:
34544
diff
changeset
|
69 a: replacing untracked file |
33c8a6837181
merge: check for path conflicts when updating (issue5628)
Mark Thomas <mbthomas@fb.com>
parents:
34544
diff
changeset
|
70 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
33c8a6837181
merge: check for path conflicts when updating (issue5628)
Mark Thomas <mbthomas@fb.com>
parents:
34544
diff
changeset
|
71 (activating bookmark dir) |
34556
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
72 $ cat a.orig |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
73 untracked |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
74 $ rm -f a.orig |
34544
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
75 |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
76 Basic clean update - local directory conflicts with changed remote file |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
77 |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
78 $ hg up -q file |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
79 $ rm a |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
80 $ mkdir a |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
81 $ echo 4 > a/b |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
82 $ hg up file2 |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
83 abort: *: '$TESTTMP/repo/a' (glob) |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
84 [255] |
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
85 $ hg up --clean file2 |
34556
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
87 (activating bookmark file2) |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
88 |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
89 Repo state is ok |
34544
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
90 |
34556
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
91 $ hg sum |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
92 parent: 2:f64e09fac717 |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
93 file2 |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
94 branch: default |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
95 bookmarks: *file2 |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
96 commit: (clean) |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
97 update: 1 new changesets, 2 branch heads (merge) |
7a8a16f8ea22
context: also consider path conflicts when clearing unknown files
Mark Thomas <mbthomas@fb.com>
parents:
34555
diff
changeset
|
98 phases: 4 draft |
34544
34c8080d12ac
tests: add a test demonstrating basic path conflict failures
Mark Thomas <mbthomas@fb.com>
parents:
diff
changeset
|
99 |