| 1 |
Path conflict checking is currently disabled by default because of issue5716. |
| 2 |
Turn it on for this test. |
| 3 |
|
| 4 |
$ cat >> $HGRCPATH << EOF |
| 5 |
> [experimental] |
| 6 |
> merge.checkpathconflicts=True |
| 7 |
> EOF |
| 8 |
|
| 9 |
$ hg init repo |
| 10 |
$ cd repo |
| 11 |
$ echo base > base |
| 12 |
$ hg add base |
| 13 |
$ hg commit -m "base" |
| 14 |
$ hg bookmark -i base |
| 15 |
$ mkdir a |
| 16 |
$ echo 1 > a/b |
| 17 |
$ hg add a/b |
| 18 |
$ hg commit -m "file" |
| 19 |
$ hg bookmark -i file |
| 20 |
$ echo 2 > a/b |
| 21 |
$ hg commit -m "file2" |
| 22 |
$ hg bookmark -i file2 |
| 23 |
$ hg up 0 |
| 24 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 25 |
$ mkdir a |
| 26 |
#if symlink |
| 27 |
$ ln -s c a/b |
| 28 |
#else |
| 29 |
$ touch a/b |
| 30 |
#endif |
| 31 |
$ hg add a/b |
| 32 |
$ hg commit -m "link" |
| 33 |
created new head |
| 34 |
$ hg bookmark -i link |
| 35 |
$ hg up 0 |
| 36 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 37 |
$ mkdir -p a/b/c |
| 38 |
$ echo 2 > a/b/c/d |
| 39 |
$ hg add a/b/c/d |
| 40 |
$ hg commit -m "dir" |
| 41 |
created new head |
| 42 |
$ hg bookmark -i dir |
| 43 |
|
| 44 |
Update - local file conflicts with remote directory: |
| 45 |
|
| 46 |
$ hg up -q 0 |
| 47 |
$ mkdir a |
| 48 |
$ echo 9 > a/b |
| 49 |
$ hg up dir |
| 50 |
a/b: untracked file conflicts with directory |
| 51 |
abort: untracked files in working directory differ from files in requested revision |
| 52 |
[20] |
| 53 |
$ hg up dir --config merge.checkunknown=warn |
| 54 |
a/b: replacing untracked file |
| 55 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 56 |
(activating bookmark dir) |
| 57 |
$ cat a/b.orig |
| 58 |
9 |
| 59 |
$ rm a/b.orig |
| 60 |
|
| 61 |
Update - local symlink conflicts with remote directory: |
| 62 |
|
| 63 |
$ hg up -q 0 |
| 64 |
$ mkdir a |
| 65 |
#if symlink |
| 66 |
$ ln -s x a/b |
| 67 |
#else |
| 68 |
$ touch a/b |
| 69 |
#endif |
| 70 |
$ hg up dir |
| 71 |
a/b: untracked file conflicts with directory |
| 72 |
abort: untracked files in working directory differ from files in requested revision |
| 73 |
[20] |
| 74 |
$ hg up dir --config merge.checkunknown=warn |
| 75 |
a/b: replacing untracked file |
| 76 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 77 |
(activating bookmark dir) |
| 78 |
#if symlink |
| 79 |
$ readlink.py a/b.orig |
| 80 |
a/b.orig -> x |
| 81 |
#endif |
| 82 |
$ rm a/b.orig |
| 83 |
|
| 84 |
Update - local directory conflicts with remote file |
| 85 |
|
| 86 |
$ hg up -q 0 |
| 87 |
$ mkdir -p a/b/c |
| 88 |
$ echo 9 > a/b/c/d |
| 89 |
$ hg up file |
| 90 |
a/b: untracked directory conflicts with file |
| 91 |
abort: untracked files in working directory differ from files in requested revision |
| 92 |
[20] |
| 93 |
$ hg up file --config merge.checkunknown=warn |
| 94 |
a/b: replacing untracked files in directory |
| 95 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 96 |
(activating bookmark file) |
| 97 |
$ cat a/b |
| 98 |
1 |
| 99 |
$ test -d a/b.orig |
| 100 |
$ rm -rf a/b.orig |
| 101 |
|
| 102 |
Update - local directory conflicts with remote symlink |
| 103 |
|
| 104 |
$ hg up -q 0 |
| 105 |
$ mkdir -p a/b/c |
| 106 |
$ echo 9 > a/b/c/d |
| 107 |
$ hg up link |
| 108 |
a/b: untracked directory conflicts with file |
| 109 |
abort: untracked files in working directory differ from files in requested revision |
| 110 |
[20] |
| 111 |
$ hg up link --config merge.checkunknown=warn |
| 112 |
a/b: replacing untracked files in directory |
| 113 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 114 |
(activating bookmark link) |
| 115 |
#if symlink |
| 116 |
$ readlink.py a/b |
| 117 |
a/b -> c |
| 118 |
#endif |
| 119 |
$ test -d a/b.orig |
| 120 |
$ rm -rf a/b.orig |
| 121 |
|
| 122 |
Update - local renamed file conflicts with remote directory |
| 123 |
|
| 124 |
$ hg up -q 0 |
| 125 |
$ hg mv base a |
| 126 |
$ hg status -C |
| 127 |
A a |
| 128 |
base |
| 129 |
R base |
| 130 |
$ hg up --check dir |
| 131 |
abort: uncommitted changes |
| 132 |
[20] |
| 133 |
$ hg up dir |
| 134 |
a: path conflict - a file or link has the same name as a directory |
| 135 |
the local file has been renamed to a~d20a80d4def3 |
| 136 |
resolve manually then use 'hg resolve --mark a' |
| 137 |
1 files updated, 0 files merged, 0 files removed, 1 files unresolved |
| 138 |
use 'hg resolve' to retry unresolved file merges |
| 139 |
(activating bookmark dir) |
| 140 |
[1] |
| 141 |
$ hg status -C |
| 142 |
A a~d20a80d4def3 |
| 143 |
base |
| 144 |
R base |
| 145 |
$ hg resolve --list |
| 146 |
P a |
| 147 |
$ hg up --clean -q 0 |
| 148 |
|
| 149 |
Update clean - local directory conflicts with changed remote file |
| 150 |
|
| 151 |
$ hg up -q file |
| 152 |
$ rm a/b |
| 153 |
$ mkdir a/b |
| 154 |
$ echo 9 > a/b/c |
| 155 |
$ hg up file2 --check --config merge.checkunknown=warn |
| 156 |
abort: uncommitted changes |
| 157 |
[20] |
| 158 |
$ hg up file2 --clean |
| 159 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 160 |
(activating bookmark file2) |