Show More
@@ -0,0 +1,50 b'' | |||||
|
1 | #!/bin/sh | |||
|
2 | ||||
|
3 | hg init | |||
|
4 | ||||
|
5 | echo "# revision 0" | |||
|
6 | echo "unchanged" > unchanged | |||
|
7 | echo "remove me" > remove | |||
|
8 | echo "copy me" > copy | |||
|
9 | echo "move me" > move | |||
|
10 | for i in 1 2 3 4 5 6 7 8 9; do | |||
|
11 | echo "merge ok $i" >> zzz1_merge_ok | |||
|
12 | done | |||
|
13 | echo "merge bad" > zzz2_merge_bad | |||
|
14 | hg ci -Am "revision 0" -d "1000000 0" | |||
|
15 | ||||
|
16 | echo "# revision 1" | |||
|
17 | hg rm remove | |||
|
18 | hg mv move moved | |||
|
19 | hg cp copy copied | |||
|
20 | echo "added" > added | |||
|
21 | hg add added | |||
|
22 | echo "new first line" > zzz1_merge_ok | |||
|
23 | hg cat zzz1_merge_ok >> zzz1_merge_ok | |||
|
24 | echo "new last line" >> zzz2_merge_bad | |||
|
25 | hg ci -m "revision 1" -d "1000000 0" | |||
|
26 | ||||
|
27 | echo "# local changes to revision 0" | |||
|
28 | hg co 0 | |||
|
29 | echo "new last line" >> zzz1_merge_ok | |||
|
30 | echo "another last line" >> zzz2_merge_bad | |||
|
31 | hg diff --nodates | grep "^[+-][^<>]" | |||
|
32 | hg st | |||
|
33 | ||||
|
34 | echo "# local merge with bad merge tool" | |||
|
35 | HGMERGE=false hg co | |||
|
36 | hg co 0 | |||
|
37 | hg diff --nodates | grep "^[+-][^<>]" | |||
|
38 | hg st | |||
|
39 | ||||
|
40 | echo "# local merge with conflicts" | |||
|
41 | HGMERGE=merge hg co | |||
|
42 | hg co 0 | |||
|
43 | hg diff --nodates | grep "^[+-][^<>]" | |||
|
44 | hg st | |||
|
45 | ||||
|
46 | echo "# local merge without conflicts" | |||
|
47 | hg revert zzz2_merge_bad | |||
|
48 | HGMERGE=merge hg co | |||
|
49 | hg diff --nodates | grep "^[+-][^<>]" | |||
|
50 | hg st |
@@ -0,0 +1,67 b'' | |||||
|
1 | # revision 0 | |||
|
2 | adding copy | |||
|
3 | adding move | |||
|
4 | adding remove | |||
|
5 | adding unchanged | |||
|
6 | adding zzz1_merge_ok | |||
|
7 | adding zzz2_merge_bad | |||
|
8 | # revision 1 | |||
|
9 | # local changes to revision 0 | |||
|
10 | 4 files updated, 0 files merged, 3 files removed, 0 files unresolved | |||
|
11 | --- a/zzz1_merge_ok | |||
|
12 | +++ b/zzz1_merge_ok | |||
|
13 | +new last line | |||
|
14 | --- a/zzz2_merge_bad | |||
|
15 | +++ b/zzz2_merge_bad | |||
|
16 | +another last line | |||
|
17 | M zzz1_merge_ok | |||
|
18 | M zzz2_merge_bad | |||
|
19 | # local merge with bad merge tool | |||
|
20 | merging zzz1_merge_ok | |||
|
21 | merging zzz1_merge_ok failed! | |||
|
22 | merging zzz2_merge_bad | |||
|
23 | merging zzz2_merge_bad failed! | |||
|
24 | 3 files updated, 0 files merged, 2 files removed, 2 files unresolved | |||
|
25 | There are unresolved merges with locally modified files. | |||
|
26 | You can redo the full merge using: | |||
|
27 | hg update 0 | |||
|
28 | hg update 1 | |||
|
29 | 2 files updated, 0 files merged, 3 files removed, 0 files unresolved | |||
|
30 | --- a/zzz1_merge_ok | |||
|
31 | +++ b/zzz1_merge_ok | |||
|
32 | +new last line | |||
|
33 | --- a/zzz2_merge_bad | |||
|
34 | +++ b/zzz2_merge_bad | |||
|
35 | +another last line | |||
|
36 | M zzz1_merge_ok | |||
|
37 | M zzz2_merge_bad | |||
|
38 | # local merge with conflicts | |||
|
39 | merge: warning: conflicts during merge | |||
|
40 | merging zzz1_merge_ok | |||
|
41 | merging zzz2_merge_bad | |||
|
42 | merging zzz2_merge_bad failed! | |||
|
43 | 3 files updated, 1 files merged, 2 files removed, 1 files unresolved | |||
|
44 | There are unresolved merges with locally modified files. | |||
|
45 | You can finish the partial merge using: | |||
|
46 | hg update 0 | |||
|
47 | hg update 1 | |||
|
48 | 2 files updated, 0 files merged, 3 files removed, 0 files unresolved | |||
|
49 | --- a/zzz1_merge_ok | |||
|
50 | +++ b/zzz1_merge_ok | |||
|
51 | +new first line | |||
|
52 | +new last line | |||
|
53 | --- a/zzz2_merge_bad | |||
|
54 | +++ b/zzz2_merge_bad | |||
|
55 | +another last line | |||
|
56 | +======= | |||
|
57 | +new last line | |||
|
58 | M zzz1_merge_ok | |||
|
59 | M zzz2_merge_bad | |||
|
60 | # local merge without conflicts | |||
|
61 | merging zzz1_merge_ok | |||
|
62 | 4 files updated, 1 files merged, 2 files removed, 0 files unresolved | |||
|
63 | --- a/zzz1_merge_ok | |||
|
64 | +++ b/zzz1_merge_ok | |||
|
65 | +new last line | |||
|
66 | M zzz1_merge_ok | |||
|
67 | ? zzz2_merge_bad.orig |
@@ -234,11 +234,19 b' def _update(repo, node): return update(r' | |||||
234 |
|
234 | |||
235 | def update(repo, node): |
|
235 | def update(repo, node): | |
236 | """update the working directory to node, merging linear changes""" |
|
236 | """update the working directory to node, merging linear changes""" | |
|
237 | pl = repo.parents() | |||
237 | stats = _merge.update(repo, node, False, False, None, None) |
|
238 | stats = _merge.update(repo, node, False, False, None, None) | |
238 | _showstats(repo, stats) |
|
239 | _showstats(repo, stats) | |
239 | if stats[3]: |
|
240 | if stats[3]: | |
240 | repo.ui.status(_("There are unresolved merges with" |
|
241 | repo.ui.status(_("There are unresolved merges with" | |
241 | " locally modified files.\n")) |
|
242 | " locally modified files.\n")) | |
|
243 | if stats[1]: | |||
|
244 | repo.ui.status(_("You can finish the partial merge using:\n")) | |||
|
245 | else: | |||
|
246 | repo.ui.status(_("You can redo the full merge using:\n")) | |||
|
247 | # len(pl)==1, otherwise _merge.update() would have raised util.Abort: | |||
|
248 | repo.ui.status(_(" hg update %s\n hg update %s\n") | |||
|
249 | % (pl[0].rev(), repo.changectx(node).rev())) | |||
242 | return stats[3] |
|
250 | return stats[3] | |
243 |
|
251 | |||
244 | def clean(repo, node, wlock=None, show_stats=True): |
|
252 | def clean(repo, node, wlock=None, show_stats=True): |
@@ -14,6 +14,9 b' merging file1' | |||||
14 | merging file1 failed! |
|
14 | merging file1 failed! | |
15 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
15 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
16 | There are unresolved merges with locally modified files. |
|
16 | There are unresolved merges with locally modified files. | |
|
17 | You can redo the full merge using: | |||
|
18 | hg update 0 | |||
|
19 | hg update 1 | |||
17 | diff -r f248da0d4c3e file1 |
|
20 | diff -r f248da0d4c3e file1 | |
18 | --- a/file1 |
|
21 | --- a/file1 | |
19 | +++ b/file1 |
|
22 | +++ b/file1 |
General Comments 0
You need to be logged in to leave comments.
Login now