##// END OF EJS Templates
tests: add tests of debugmergestate with unresolved/resolved path conflicts...
Martin von Zweigbergk -
r44879:382f4f09 default
parent child Browse files
Show More
@@ -1,161 +1,177 b''
1 1 Path conflict checking is currently disabled by default because of issue5716.
2 2 Turn it on for this test.
3 3
4 4 $ cat >> $HGRCPATH << EOF
5 5 > [experimental]
6 6 > merge.checkpathconflicts=True
7 7 > EOF
8 8
9 9 $ hg init repo
10 10 $ cd repo
11 11 $ echo base > base
12 12 $ hg add base
13 13 $ hg commit -m "base"
14 14 $ hg bookmark -i base
15 15 $ mkdir a
16 16 $ echo 1 > a/b
17 17 $ hg add a/b
18 18 $ hg commit -m "file"
19 19 $ hg bookmark -i file
20 20 $ echo 2 > a/b
21 21 $ hg commit -m "file2"
22 22 $ hg bookmark -i file2
23 23 $ hg up 0
24 24 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
25 25
26 26 #if symlink
27 27 $ mkdir a
28 28 $ ln -s c a/b
29 29 $ hg add a/b
30 30 $ hg commit -m "link"
31 31 created new head
32 32 #else
33 33 $ hg import -q --bypass - <<EOF
34 34 > # HG changeset patch
35 35 > link
36 36 >
37 37 > diff --git a/a/b b/a/b
38 38 > new file mode 120000
39 39 > --- /dev/null
40 40 > +++ b/a/b
41 41 > @@ -0,0 +1,1 @@
42 42 > +c
43 43 > \ No newline at end of file
44 44 > EOF
45 45 $ hg up -q
46 46 #endif
47 47
48 48 $ hg bookmark -i link
49 49 $ hg up 0
50 50 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
51 51 $ mkdir -p a/b/c
52 52 $ echo 2 > a/b/c/d
53 53 $ hg add a/b/c/d
54 54 $ hg commit -m "dir"
55 55 created new head
56 56 $ hg bookmark -i dir
57 57
58 58 Merge - local file conflicts with remote directory
59 59
60 60 $ hg up file
61 61 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
62 62 (activating bookmark file)
63 63 $ hg bookmark -i
64 64 $ hg merge --verbose dir
65 65 resolving manifests
66 66 a/b: path conflict - a file or link has the same name as a directory
67 67 the local file has been renamed to a/b~0ed027b96f31
68 68 resolve manually then use 'hg resolve --mark a/b'
69 69 moving a/b to a/b~0ed027b96f31
70 70 getting a/b/c/d
71 71 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
72 72 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
73 73 [1]
74 74 $ hg status
75 75 M a/b/c/d
76 76 A a/b~0ed027b96f31
77 77 R a/b
78 $ hg debugmergestate
79 * version 2 records
80 local: 0ed027b96f31a2560c8abe689ba59876409a2b8e
81 other: 9049d9534d5c5d16264aab02b4b9e20d03faabef
82 labels:
83 local: working copy
84 other: merge rev
85 unrecognized entry: P a/b pu a/b~0ed027b96f31 l
78 86 $ hg resolve --all
79 87 a/b: path conflict must be resolved manually
80 88 $ hg forget a/b~0ed027b96f31 && rm a/b~0ed027b96f31
81 89 $ hg resolve --mark a/b
82 90 (no more unresolved files)
83 91 $ hg commit -m "merge file and dir (deleted file)"
84 92
85 93 Merge - local symlink conflicts with remote directory
86 94
87 95 $ hg up link
88 96 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
89 97 (activating bookmark link)
90 98 $ hg bookmark -i
91 99 $ hg merge dir
92 100 a/b: path conflict - a file or link has the same name as a directory
93 101 the local file has been renamed to a/b~2ea68033e3be
94 102 resolve manually then use 'hg resolve --mark a/b'
95 103 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
96 104 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
97 105 [1]
98 106 $ hg status
99 107 M a/b/c/d
100 108 A a/b~2ea68033e3be
101 109 R a/b
102 110 $ hg resolve --list
103 111 P a/b
104 112 $ hg resolve --all
105 113 a/b: path conflict must be resolved manually
106 114 $ hg mv a/b~2ea68033e3be a/b.old
107 115 $ hg resolve --mark a/b
108 116 (no more unresolved files)
117 $ hg debugmergestate
118 * version 2 records
119 local: 2ea68033e3be03a560471c1fc9e5704fbedb9b4b
120 other: 9049d9534d5c5d16264aab02b4b9e20d03faabef
121 labels:
122 local: working copy
123 other: merge rev
124 unrecognized entry: P a/b pr a/b~2ea68033e3be l
109 125 $ hg resolve --list
110 126 R a/b
111 127 $ hg commit -m "merge link and dir (renamed link)"
112 128
113 129 Merge - local directory conflicts with remote file or link
114 130
115 131 $ hg up dir
116 132 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
117 133 (activating bookmark dir)
118 134 $ hg bookmark -i
119 135 $ hg merge file
120 136 a/b: path conflict - a file or link has the same name as a directory
121 137 the remote file has been renamed to a/b~0ed027b96f31
122 138 resolve manually then use 'hg resolve --mark a/b'
123 139 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
124 140 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
125 141 [1]
126 142 $ hg status
127 143 A a/b~0ed027b96f31
128 144 $ hg resolve --all
129 145 a/b: path conflict must be resolved manually
130 146 $ hg mv a/b~0ed027b96f31 a/b/old-b
131 147 $ hg resolve --mark a/b
132 148 (no more unresolved files)
133 149 $ hg commit -m "merge dir and file (move file into dir)"
134 150 created new head
135 151 $ hg merge file2
136 152 merging a/b/old-b and a/b to a/b/old-b
137 153 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
138 154 (branch merge, don't forget to commit)
139 155 $ cat a/b/old-b
140 156 2
141 157 $ hg commit -m "merge file2 (copytrace tracked rename)"
142 158 $ hg merge link
143 159 a/b: path conflict - a file or link has the same name as a directory
144 160 the remote file has been renamed to a/b~2ea68033e3be
145 161 resolve manually then use 'hg resolve --mark a/b'
146 162 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
147 163 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
148 164 [1]
149 165 $ hg mv a/b~2ea68033e3be a/b.old
150 166
151 167 #if symlink
152 168 $ readlink.py a/b.old
153 169 a/b.old -> c
154 170 #else
155 171 $ cat a/b.old
156 172 c (no-eol)
157 173 #endif
158 174
159 175 $ hg resolve --mark a/b
160 176 (no more unresolved files)
161 177 $ hg commit -m "merge link (rename link)"
General Comments 0
You need to be logged in to leave comments. Login now