Show More
@@ -0,0 +1,40 b'' | |||
|
1 | #!/bin/sh | |
|
2 | ||
|
3 | echo "[extensions]" >> $HGRCPATH | |
|
4 | echo "graphlog=" >> $HGRCPATH | |
|
5 | ||
|
6 | function addcommit { | |
|
7 | echo $1 > $1 | |
|
8 | hg add $1 | |
|
9 | hg commit -d "${2} 0" -u test -m $1 | |
|
10 | } | |
|
11 | function commit { | |
|
12 | hg commit -d "${2} 0" -u test -m $1 | |
|
13 | } | |
|
14 | ||
|
15 | hg init a | |
|
16 | cd a | |
|
17 | addcommit "A" 0 | |
|
18 | addcommit "B" 1 | |
|
19 | echo "C" >> A | |
|
20 | commit "C" 2 | |
|
21 | ||
|
22 | hg update -C 0 | |
|
23 | echo "D" >> A | |
|
24 | commit "D" 3 | |
|
25 | ||
|
26 | echo | |
|
27 | echo "% Merging a conflict araises" | |
|
28 | hg merge | |
|
29 | ||
|
30 | echo | |
|
31 | echo "% Correct the conflict without marking the file as resolved" | |
|
32 | echo "ABCD" > A | |
|
33 | hg commit -m "Merged" | |
|
34 | ||
|
35 | echo | |
|
36 | echo "% Mark the conflict as resolved and commit" | |
|
37 | hg resolve -m A | |
|
38 | hg commit -m "Merged" | |
|
39 | ||
|
40 | exit 0 |
@@ -0,0 +1,14 b'' | |||
|
1 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
2 | created new head | |
|
3 | ||
|
4 | % Merging a conflict araises | |
|
5 | merging A | |
|
6 | warning: conflicts during merge. | |
|
7 | merging A failed! | |
|
8 | 1 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
|
9 | use 'hg resolve' to retry unresolved file merges | |
|
10 | ||
|
11 | % Correct the conflict without marking the file as resolved | |
|
12 | abort: unresolved merge conflicts (see hg resolve) | |
|
13 | ||
|
14 | % Mark the conflict as resolved and commit |
@@ -12,6 +12,7 b' import changelog, dirstate, filelog, man' | |||
|
12 | 12 | import lock, transaction, stat, errno, ui, store |
|
13 | 13 | import os, revlog, time, util, extensions, hook, inspect |
|
14 | 14 | import match as match_ |
|
15 | import merge as merge_ | |
|
15 | 16 | |
|
16 | 17 | class localrepository(repo.repository): |
|
17 | 18 | capabilities = util.set(('lookup', 'changegroupsubset')) |
@@ -777,6 +778,11 b' class localrepository(repo.repository):' | |||
|
777 | 778 | update_dirstate = (self.dirstate.parents()[0] == p1) |
|
778 | 779 | changes = [files, [], [], [], []] |
|
779 | 780 | |
|
781 | ms = merge_.mergestate(self) | |
|
782 | for f in changes[0]: | |
|
783 | if f in ms and ms[f] == 'u': | |
|
784 | raise util.Abort(_("unresolved merge conflicts " | |
|
785 | "(see hg resolve)")) | |
|
780 | 786 | wctx = context.workingctx(self, (p1, p2), text, user, date, |
|
781 | 787 | extra, changes) |
|
782 | 788 | return self._commitctx(wctx, force, force_editor, empty_ok, |
@@ -32,6 +32,7 b' hg st' | |||
|
32 | 32 | echo % should fail |
|
33 | 33 | hg add a |
|
34 | 34 | hg st |
|
35 | hg resolve -m a | |
|
35 | 36 | hg ci -m merge |
|
36 | 37 | |
|
37 | 38 | echo % issue683 |
General Comments 0
You need to be logged in to leave comments.
Login now