Show More
@@ -797,7 +797,7 b' def backout(ui, repo, rev, **opts):' | |||||
797 | (nice(repo.changelog.tip()), nice(node))) |
|
797 | (nice(repo.changelog.tip()), nice(node))) | |
798 | if opts['merge'] and op1 != node: |
|
798 | if opts['merge'] and op1 != node: | |
799 | ui.status(_('merging with changeset %s\n') % nice(op1)) |
|
799 | ui.status(_('merging with changeset %s\n') % nice(op1)) | |
800 | update(ui, repo, hex(op1), **opts) |
|
800 | doupdate(ui, repo, hex(op1), **opts) | |
801 |
|
801 | |||
802 | def bundle(ui, repo, fname, dest="default-push", **opts): |
|
802 | def bundle(ui, repo, fname, dest="default-push", **opts): | |
803 | """create a changegroup file |
|
803 | """create a changegroup file | |
@@ -947,7 +947,7 b' def clone(ui, source, dest=None, **opts)' | |||||
947 | f.close() |
|
947 | f.close() | |
948 |
|
948 | |||
949 | if not opts['noupdate']: |
|
949 | if not opts['noupdate']: | |
950 | update(repo.ui, repo) |
|
950 | doupdate(repo.ui, repo) | |
951 |
|
951 | |||
952 | d.close() |
|
952 | d.close() | |
953 |
|
953 | |||
@@ -1956,7 +1956,7 b' def merge(ui, repo, node=None, **opts):' | |||||
1956 | marked as changed for the next commit and a commit must be |
|
1956 | marked as changed for the next commit and a commit must be | |
1957 | performed before any further updates are allowed. |
|
1957 | performed before any further updates are allowed. | |
1958 | """ |
|
1958 | """ | |
1959 | return update(ui, repo, node=node, merge=True, **opts) |
|
1959 | return doupdate(ui, repo, node=node, merge=True, **opts) | |
1960 |
|
1960 | |||
1961 | def outgoing(ui, repo, dest="default-push", **opts): |
|
1961 | def outgoing(ui, repo, dest="default-push", **opts): | |
1962 | """show changesets not found in destination |
|
1962 | """show changesets not found in destination | |
@@ -2035,7 +2035,7 b' def postincoming(ui, repo, modheads, opt' | |||||
2035 | return |
|
2035 | return | |
2036 | if optupdate: |
|
2036 | if optupdate: | |
2037 | if modheads == 1: |
|
2037 | if modheads == 1: | |
2038 | return update(ui, repo) |
|
2038 | return doupdate(ui, repo) | |
2039 | else: |
|
2039 | else: | |
2040 | ui.status(_("not updating, since new heads added\n")) |
|
2040 | ui.status(_("not updating, since new heads added\n")) | |
2041 | if modheads > 1: |
|
2041 | if modheads > 1: | |
@@ -2740,15 +2740,19 b' def update(ui, repo, node=None, merge=Fa' | |||||
2740 | there is a linear relationship between the current version and the |
|
2740 | there is a linear relationship between the current version and the | |
2741 | requested version, the result is the requested version. |
|
2741 | requested version, the result is the requested version. | |
2742 |
|
2742 | |||
2743 | Otherwise the result is a merge between the contents of the |
|
2743 | To merge the working directory with another revision, use the | |
2744 | current working directory and the requested version. Files that |
|
2744 | merge command. | |
2745 | changed between either parent are marked as changed for the next |
|
|||
2746 | commit and a commit must be performed before any further updates |
|
|||
2747 | are allowed. |
|
|||
2748 |
|
2745 | |||
2749 | By default, update will refuse to run if doing so would require |
|
2746 | By default, update will refuse to run if doing so would require | |
2750 | merging or discarding local changes. |
|
2747 | merging or discarding local changes. | |
2751 | """ |
|
2748 | """ | |
|
2749 | if merge: | |||
|
2750 | ui.warn(_('(the -m/--merge option is deprecated; ' | |||
|
2751 | 'use the merge command instead)\n')) | |||
|
2752 | return doupdate(ui, repo, node, merge, clean, force, branch, **opts) | |||
|
2753 | ||||
|
2754 | def doupdate(ui, repo, node=None, merge=False, clean=False, force=None, | |||
|
2755 | branch=None, **opts): | |||
2752 | if branch: |
|
2756 | if branch: | |
2753 | br = repo.branchlookup(branch=branch) |
|
2757 | br = repo.branchlookup(branch=branch) | |
2754 | found = [] |
|
2758 | found = [] | |
@@ -3115,7 +3119,7 b' table = {' | |||||
3115 | "^update|up|checkout|co": |
|
3119 | "^update|up|checkout|co": | |
3116 | (update, |
|
3120 | (update, | |
3117 | [('b', 'branch', '', _('checkout the head of a specific branch')), |
|
3121 | [('b', 'branch', '', _('checkout the head of a specific branch')), | |
3118 | ('m', 'merge', None, _('allow merging of branches')), |
|
3122 | ('m', 'merge', None, _('allow merging of branches (DEPRECATED)')), | |
3119 | ('C', 'clean', None, _('overwrite locally modified files')), |
|
3123 | ('C', 'clean', None, _('overwrite locally modified files')), | |
3120 | ('f', 'force', None, _('force a merge with outstanding changes'))], |
|
3124 | ('f', 'force', None, _('force a merge with outstanding changes'))], | |
3121 | _('hg update [-b TAG] [-m] [-C] [-f] [REV]')), |
|
3125 | _('hg update [-b TAG] [-m] [-C] [-f] [REV]')), |
@@ -16,10 +16,10 b' test-<x>.err.' | |||||
16 | There are some tricky points here that you should be aware of when |
|
16 | There are some tricky points here that you should be aware of when | |
17 | writing tests: |
|
17 | writing tests: | |
18 |
|
18 | |||
19 |
- hg commit and hg |
|
19 | - hg commit and hg merge want user interaction | |
20 |
|
20 | |||
21 | for commit use -m "text" |
|
21 | for commit use -m "text" | |
22 |
for hg |
|
22 | for hg merge, set HGMERGE to something noninteractive (like true or merge) | |
23 |
|
23 | |||
24 | - changeset hashes will change based on user and date which make |
|
24 | - changeset hashes will change based on user and date which make | |
25 | things like hg history output change |
|
25 | things like hg history output change |
@@ -10,7 +10,7 b' hg co 0' | |||||
10 | echo "something else" > a |
|
10 | echo "something else" > a | |
11 | hg commit -m branch2 -d "1000000 0" |
|
11 | hg commit -m branch2 -d "1000000 0" | |
12 | HGMERGE=merge; export HGMERGE |
|
12 | HGMERGE=merge; export HGMERGE | |
13 |
hg |
|
13 | hg merge 1 | |
14 | hg id |
|
14 | hg id | |
15 | egrep -v ">>>|<<<" a |
|
15 | egrep -v ">>>|<<<" a | |
16 | hg status |
|
16 | hg status |
@@ -28,7 +28,7 b' hg co -C 0' | |||||
28 | echo foo-b > a |
|
28 | echo foo-b > a | |
29 | hg commit -m "2b" -d "1000000 0" |
|
29 | hg commit -m "2b" -d "1000000 0" | |
30 |
|
30 | |||
31 |
HGMERGE=true hg |
|
31 | HGMERGE=true hg merge 1 | |
32 |
|
32 | |||
33 | echo "%%% should show foo-b" |
|
33 | echo "%%% should show foo-b" | |
34 | cat a |
|
34 | cat a |
@@ -17,12 +17,12 b' hg co 0' | |||||
17 | echo blah > b |
|
17 | echo blah > b | |
18 |
|
18 | |||
19 | hg ci -m "branch b" -d "1000000 0" |
|
19 | hg ci -m "branch b" -d "1000000 0" | |
20 |
HGMERGE=true hg |
|
20 | HGMERGE=true hg merge 1 | |
21 |
|
21 | |||
22 | hg ci -m "merge b/a -> blah" -d "1000000 0" |
|
22 | hg ci -m "merge b/a -> blah" -d "1000000 0" | |
23 |
|
23 | |||
24 | hg co 1 |
|
24 | hg co 1 | |
25 |
HGMERGE=true hg |
|
25 | HGMERGE=true hg merge 2 | |
26 | hg ci -m "merge a/b -> blah" -d "1000000 0" |
|
26 | hg ci -m "merge a/b -> blah" -d "1000000 0" | |
27 |
|
27 | |||
28 | hg log |
|
28 | hg log | |
@@ -43,4 +43,4 b' echo' | |||||
43 |
|
43 | |||
44 | hg debugindex .hg/data/a.i |
|
44 | hg debugindex .hg/data/a.i | |
45 |
|
45 | |||
46 | hg verify No newline at end of file |
|
46 | hg verify |
@@ -41,7 +41,7 b' hg debugstate | cut -b 1-16,35-' | |||||
41 |
|
41 | |||
42 | echo merging |
|
42 | echo merging | |
43 | hg pull ../a |
|
43 | hg pull ../a | |
44 |
env HGMERGE=../merge hg |
|
44 | env HGMERGE=../merge hg merge -v | |
45 |
|
45 | |||
46 | echo 2m > foo |
|
46 | echo 2m > foo | |
47 | echo 2b > baz |
|
47 | echo 2b > baz |
@@ -27,7 +27,7 b' hg pull ../test2' | |||||
27 | hg heads |
|
27 | hg heads | |
28 | hg history |
|
28 | hg history | |
29 |
|
29 | |||
30 |
hg -v |
|
30 | hg -v merge | |
31 |
|
31 | |||
32 | ls -l ../test[12]/a > foo |
|
32 | ls -l ../test[12]/a > foo | |
33 | cut -b 1-10 < foo |
|
33 | cut -b 1-10 < foo |
@@ -29,7 +29,7 b' hg update -C 0' | |||||
29 | echo b > b |
|
29 | echo b > b | |
30 | hg add b |
|
30 | hg add b | |
31 | hg commit -m b -d '1 0' |
|
31 | hg commit -m b -d '1 0' | |
32 | hg update -m 1 |
|
32 | hg merge 1 | |
33 | hg commit -m merge -d '2 0' |
|
33 | hg commit -m merge -d '2 0' | |
34 |
|
34 | |||
35 | cd ../b |
|
35 | cd ../b |
@@ -22,7 +22,7 b' hg add c' | |||||
22 | hg commit -m "commit #2" -d "1000000 0" |
|
22 | hg commit -m "commit #2" -d "1000000 0" | |
23 | echo This is file b1 > b |
|
23 | echo This is file b1 > b | |
24 | echo %% no merges expected |
|
24 | echo %% no merges expected | |
25 |
env HGMERGE=../merge hg |
|
25 | env HGMERGE=../merge hg merge 1 | |
26 | cd ..; /bin/rm -rf t |
|
26 | cd ..; /bin/rm -rf t | |
27 |
|
27 | |||
28 | mkdir t |
|
28 | mkdir t | |
@@ -41,9 +41,9 b' hg add c' | |||||
41 | hg commit -m "commit #2" -d "1000000 0" |
|
41 | hg commit -m "commit #2" -d "1000000 0" | |
42 | echo This is file b2 > b |
|
42 | echo This is file b2 > b | |
43 | echo %% merge should fail |
|
43 | echo %% merge should fail | |
44 |
env HGMERGE=../merge hg |
|
44 | env HGMERGE=../merge hg merge 1 | |
45 | echo %% merge of b expected |
|
45 | echo %% merge of b expected | |
46 |
env HGMERGE=../merge hg |
|
46 | env HGMERGE=../merge hg merge -f 1 | |
47 | cd ..; /bin/rm -rf t |
|
47 | cd ..; /bin/rm -rf t | |
48 | echo %% |
|
48 | echo %% | |
49 |
|
49 | |||
@@ -68,9 +68,9 b' cat b' | |||||
68 |
|
68 | |||
69 | echo This is file b22 > b |
|
69 | echo This is file b22 > b | |
70 | echo %% merge fails |
|
70 | echo %% merge fails | |
71 |
env HGMERGE=../merge hg |
|
71 | env HGMERGE=../merge hg merge 2 | |
72 | echo %% merge expected! |
|
72 | echo %% merge expected! | |
73 |
env HGMERGE=../merge hg |
|
73 | env HGMERGE=../merge hg merge -f 2 | |
74 | cd ..; /bin/rm -rf t |
|
74 | cd ..; /bin/rm -rf t | |
75 |
|
75 | |||
76 | mkdir t |
|
76 | mkdir t | |
@@ -90,7 +90,7 b' hg add c' | |||||
90 | hg commit -m "commit #3" -d "1000000 0" |
|
90 | hg commit -m "commit #3" -d "1000000 0" | |
91 | echo This is file b33 > b |
|
91 | echo This is file b33 > b | |
92 | echo %% merge of b should fail |
|
92 | echo %% merge of b should fail | |
93 |
env HGMERGE=../merge hg |
|
93 | env HGMERGE=../merge hg merge 2 | |
94 | echo %% merge of b expected |
|
94 | echo %% merge of b expected | |
95 |
env HGMERGE=../merge hg |
|
95 | env HGMERGE=../merge hg merge -f 2 | |
96 | cd ..; /bin/rm -rf t |
|
96 | cd ..; /bin/rm -rf t |
@@ -11,7 +11,7 b' hg update 0' | |||||
11 | echo This is file c1 > c |
|
11 | echo This is file c1 > c | |
12 | hg add c |
|
12 | hg add c | |
13 | hg commit -m "commit #2" -d "1000000 0" |
|
13 | hg commit -m "commit #2" -d "1000000 0" | |
14 | hg update -m 1 |
|
14 | hg merge 1 | |
15 | rm b |
|
15 | rm b | |
16 | echo This is file c22 > c |
|
16 | echo This is file c22 > c | |
17 | hg commit -m "commit #3" -d "1000000 0" |
|
17 | hg commit -m "commit #3" -d "1000000 0" |
@@ -33,14 +33,14 b' hg clone B1 B2' | |||||
33 |
|
33 | |||
34 | cd A1 |
|
34 | cd A1 | |
35 | hg pull ../B1 |
|
35 | hg pull ../B1 | |
36 | hg update -m |
|
36 | hg merge | |
37 | hg commit -m "commit test" -d "1000000 0" |
|
37 | hg commit -m "commit test" -d "1000000 0" | |
38 | echo bar should remain deleted. |
|
38 | echo bar should remain deleted. | |
39 | hg manifest |
|
39 | hg manifest | |
40 |
|
40 | |||
41 | cd ../B2 |
|
41 | cd ../B2 | |
42 | hg pull ../A2 |
|
42 | hg pull ../A2 | |
43 | hg update -m |
|
43 | hg merge | |
44 | hg commit -m "commit test" -d "1000000 0" |
|
44 | hg commit -m "commit test" -d "1000000 0" | |
45 | echo bar should remain deleted. |
|
45 | echo bar should remain deleted. | |
46 | hg manifest |
|
46 | hg manifest |
@@ -35,7 +35,7 b' hg commit -m "2 -> 2.5" -d "1000000 0"' | |||||
35 |
|
35 | |||
36 | # now pull and merge from test-a |
|
36 | # now pull and merge from test-a | |
37 | hg pull ../test-a |
|
37 | hg pull ../test-a | |
38 |
HGMERGE=merge hg |
|
38 | HGMERGE=merge hg merge | |
39 | # resolve conflict |
|
39 | # resolve conflict | |
40 | cat >test.txt <<"EOF" |
|
40 | cat >test.txt <<"EOF" | |
41 | one |
|
41 | one | |
@@ -57,7 +57,7 b' hg commit -m "two -> two-point-one" -d "' | |||||
57 | # pull and merge from test-a again |
|
57 | # pull and merge from test-a again | |
58 | cd ../test-b |
|
58 | cd ../test-b | |
59 | hg pull ../test-a |
|
59 | hg pull ../test-a | |
60 |
HGMERGE=merge hg |
|
60 | HGMERGE=merge hg merge --debug | |
61 |
|
61 | |||
62 | cat test.txt | sed "s% .*%%" |
|
62 | cat test.txt | sed "s% .*%%" | |
63 |
|
63 |
@@ -22,7 +22,7 b' added 1 changesets with 1 changes to 1 f' | |||||
22 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
22 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
23 | merge: warning: conflicts during merge |
|
23 | merge: warning: conflicts during merge | |
24 | resolving manifests |
|
24 | resolving manifests | |
25 |
force |
|
25 | force False allow True moddirstate True linear False | |
26 | ancestor 055d847dd401 local 2eded9ab0a5c remote 84cf5750dd20 |
|
26 | ancestor 055d847dd401 local 2eded9ab0a5c remote 84cf5750dd20 | |
27 | test.txt versions differ, resolve |
|
27 | test.txt versions differ, resolve | |
28 | merging test.txt |
|
28 | merging test.txt |
@@ -23,7 +23,7 b' hg commit -m "3" -d "1000000 0"' | |||||
23 | hg push ../a |
|
23 | hg push ../a | |
24 | hg pull ../a |
|
24 | hg pull ../a | |
25 | hg push ../a |
|
25 | hg push ../a | |
26 | hg up -m |
|
26 | hg merge | |
27 | hg commit -m "4" -d "1000000 0" |
|
27 | hg commit -m "4" -d "1000000 0" | |
28 | hg push ../a |
|
28 | hg push ../a | |
29 | cd .. |
|
29 | cd .. | |
@@ -44,7 +44,7 b' for i in 0 1; do' | |||||
44 | hg ci -m d-$i -d "1000000 0" |
|
44 | hg ci -m d-$i -d "1000000 0" | |
45 | done |
|
45 | done | |
46 |
|
46 | |||
47 |
HGMERGE=true hg |
|
47 | HGMERGE=true hg merge 3 | |
48 | hg ci -m c-d -d "1000000 0" |
|
48 | hg ci -m c-d -d "1000000 0" | |
49 |
|
49 | |||
50 | hg push ../c |
|
50 | hg push ../c |
@@ -14,4 +14,4 b" echo 'stationary' >>b/vehicle" | |||||
14 | "$HG" commit -m 'Clarifying the vehicle.' |
|
14 | "$HG" commit -m 'Clarifying the vehicle.' | |
15 | "$HG" update -C 1 |
|
15 | "$HG" update -C 1 | |
16 | chmod a-w b/vehicle |
|
16 | chmod a-w b/vehicle | |
17 |
"$HG" |
|
17 | "$HG" merge 2 2>&1 | sed 's|^\(.*[ ]\).*/\([^/]*/[^/]*/[^/]*\)$|\1\2|g' |
@@ -27,7 +27,7 b' echo 1 > b' | |||||
27 | hg add b |
|
27 | hg add b | |
28 | hg commit -m "branch" -d "1000000 0" |
|
28 | hg commit -m "branch" -d "1000000 0" | |
29 | hg id |
|
29 | hg id | |
30 |
hg |
|
30 | hg merge 1 | |
31 | hg id |
|
31 | hg id | |
32 | hg status |
|
32 | hg status | |
33 |
|
33 |
@@ -29,7 +29,7 b' hg --debug up' | |||||
29 | hg parents |
|
29 | hg parents | |
30 | hg --debug up 0 |
|
30 | hg --debug up 0 | |
31 | hg parents |
|
31 | hg parents | |
32 |
hg --debug |
|
32 | hg --debug merge || echo failed | |
33 | hg parents |
|
33 | hg parents | |
34 | hg --debug up |
|
34 | hg --debug up | |
35 | hg parents |
|
35 | hg parents | |
@@ -50,8 +50,8 b' hg -q pull ../r1' | |||||
50 | hg status |
|
50 | hg status | |
51 | hg parents |
|
51 | hg parents | |
52 | hg --debug up || echo failed |
|
52 | hg --debug up || echo failed | |
53 |
hg --debug |
|
53 | hg --debug merge || echo failed | |
54 |
hg --debug |
|
54 | hg --debug merge -f | |
55 | hg parents |
|
55 | hg parents | |
56 | hg diff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
56 | hg diff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
57 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
|
57 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
@@ -112,7 +112,7 b' failed' | |||||
112 | abort: outstanding uncommitted changes |
|
112 | abort: outstanding uncommitted changes | |
113 | failed |
|
113 | failed | |
114 | resolving manifests |
|
114 | resolving manifests | |
115 |
force |
|
115 | force False allow True moddirstate True linear False | |
116 | ancestor a0c8bcbbb45c local 1165e8bd193e remote 4096f2872392 |
|
116 | ancestor a0c8bcbbb45c local 1165e8bd193e remote 4096f2872392 | |
117 | a versions differ, resolve |
|
117 | a versions differ, resolve | |
118 | b versions differ, resolve |
|
118 | b versions differ, resolve |
General Comments 0
You need to be logged in to leave comments.
Login now