Show More
@@ -1,149 +1,149 b'' | |||
|
1 | 1 | test that a commit clears the merge state. |
|
2 | 2 | |
|
3 | 3 | $ hg init repo |
|
4 | 4 | $ cd repo |
|
5 | 5 | |
|
6 | 6 | $ echo foo > file1 |
|
7 | 7 | $ echo foo > file2 |
|
8 | 8 | $ hg commit -Am 'add files' |
|
9 | 9 | adding file1 |
|
10 | 10 | adding file2 |
|
11 | 11 | |
|
12 | 12 | $ echo bar >> file1 |
|
13 | 13 | $ echo bar >> file2 |
|
14 | 14 | $ hg commit -Am 'append bar to files' |
|
15 | 15 | |
|
16 | 16 | create a second head with conflicting edits |
|
17 | 17 | |
|
18 | 18 | $ hg up -C 0 |
|
19 | 19 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
20 | 20 | $ echo baz >> file1 |
|
21 | 21 | $ echo baz >> file2 |
|
22 | 22 | $ hg commit -Am 'append baz to files' |
|
23 | 23 | created new head |
|
24 | 24 | |
|
25 | 25 | create a third head with no conflicting edits |
|
26 | 26 | $ hg up -qC 0 |
|
27 | 27 | $ echo foo > file3 |
|
28 | 28 | $ hg commit -Am 'add non-conflicting file' |
|
29 | 29 | adding file3 |
|
30 | 30 | created new head |
|
31 | 31 | |
|
32 | 32 | failing merge |
|
33 | 33 | |
|
34 | 34 | $ hg up -qC 2 |
|
35 | 35 | $ hg merge --tool=internal:fail 1 |
|
36 | 36 | 0 files updated, 0 files merged, 0 files removed, 2 files unresolved |
|
37 | 37 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
38 | 38 | [1] |
|
39 | 39 | |
|
40 | 40 | resolve -l should contain unresolved entries |
|
41 | 41 | |
|
42 | 42 | $ hg resolve -l |
|
43 | 43 | U file1 |
|
44 | 44 | U file2 |
|
45 | 45 | |
|
46 | 46 | resolving an unknown path should emit a warning |
|
47 | 47 | |
|
48 | 48 | $ hg resolve -m does-not-exist |
|
49 | 49 | arguments do not match paths that need resolving |
|
50 | 50 | |
|
51 | 51 | resolve the failure |
|
52 | 52 | |
|
53 | 53 | $ echo resolved > file1 |
|
54 | 54 | $ hg resolve -m file1 |
|
55 | 55 | |
|
56 | 56 | resolve -l should show resolved file as resolved |
|
57 | 57 | |
|
58 | 58 | $ hg resolve -l |
|
59 | 59 | R file1 |
|
60 | 60 | U file2 |
|
61 | 61 | |
|
62 | 62 | resolve -m without paths should mark all resolved |
|
63 | 63 | |
|
64 | 64 | $ hg resolve -m |
|
65 | 65 | (no more unresolved files) |
|
66 | 66 | $ hg commit -m 'resolved' |
|
67 | 67 | |
|
68 | 68 | resolve -l should be empty after commit |
|
69 | 69 | |
|
70 | 70 | $ hg resolve -l |
|
71 | 71 | |
|
72 | 72 | resolve --all should abort when no merge in progress |
|
73 | 73 | |
|
74 | 74 | $ hg resolve --all |
|
75 | 75 | abort: resolve command not applicable when not merging |
|
76 | 76 | [255] |
|
77 | 77 | |
|
78 | 78 | resolve -m should abort when no merge in progress |
|
79 | 79 | |
|
80 | 80 | $ hg resolve -m |
|
81 | 81 | abort: resolve command not applicable when not merging |
|
82 | 82 | [255] |
|
83 | 83 | |
|
84 | 84 | set up conflict-free merge |
|
85 | 85 | |
|
86 | 86 | $ hg up -qC 3 |
|
87 | 87 | $ hg merge 1 |
|
88 | 88 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
89 | 89 | (branch merge, don't forget to commit) |
|
90 | 90 | |
|
91 | 91 | resolve --all should do nothing in merge without conflicts |
|
92 | 92 | $ hg resolve --all |
|
93 | 93 | (no more unresolved files) |
|
94 | 94 | |
|
95 | 95 | resolve -m should do nothing in merge without conflicts |
|
96 | 96 | |
|
97 | 97 | $ hg resolve -m |
|
98 | 98 | (no more unresolved files) |
|
99 | 99 | |
|
100 | 100 | get back to conflicting state |
|
101 | 101 | |
|
102 | 102 | $ hg up -qC 2 |
|
103 | 103 | $ hg merge --tool=internal:fail 1 |
|
104 | 104 | 0 files updated, 0 files merged, 0 files removed, 2 files unresolved |
|
105 | 105 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
106 | 106 | [1] |
|
107 | 107 | |
|
108 | 108 | resolve without arguments should suggest --all |
|
109 | 109 | $ hg resolve |
|
110 | 110 | abort: no files or directories specified |
|
111 | 111 | (use --all to remerge all files) |
|
112 | 112 | [255] |
|
113 | 113 | |
|
114 | 114 | resolve --all should re-merge all unresolved files |
|
115 | 115 | $ hg resolve -q --all |
|
116 | 116 | warning: conflicts during merge. |
|
117 | 117 | merging file1 incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
118 | 118 | warning: conflicts during merge. |
|
119 | 119 | merging file2 incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
120 | 120 | [1] |
|
121 |
$ grep |
|
|
122 |
$ grep |
|
|
121 | $ grep '<<<' file1 > /dev/null | |
|
122 | $ grep '<<<' file2 > /dev/null | |
|
123 | 123 | |
|
124 | 124 | resolve <file> should re-merge file |
|
125 | 125 | $ echo resolved > file1 |
|
126 | 126 | $ hg resolve -q file1 |
|
127 | 127 | warning: conflicts during merge. |
|
128 | 128 | merging file1 incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
129 | 129 | [1] |
|
130 |
$ grep |
|
|
130 | $ grep '<<<' file1 > /dev/null | |
|
131 | 131 | |
|
132 | 132 | resolve <file> should do nothing if 'file' was marked resolved |
|
133 | 133 | $ echo resolved > file1 |
|
134 | 134 | $ hg resolve -m file1 |
|
135 | 135 | $ hg resolve -q file1 |
|
136 | 136 | $ cat file1 |
|
137 | 137 | resolved |
|
138 | 138 | |
|
139 | 139 | test crashed merge with empty mergestate |
|
140 | 140 | |
|
141 | 141 | $ hg up -qC 1 |
|
142 | 142 | $ mkdir .hg/merge |
|
143 | 143 | $ touch .hg/merge/state |
|
144 | 144 | |
|
145 | 145 | resolve -l should be empty |
|
146 | 146 | |
|
147 | 147 | $ hg resolve -l |
|
148 | 148 | |
|
149 | 149 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now