Show More
@@ -1749,7 +1749,7 b' class localrepository:' | |||
|
1749 | 1749 | |
|
1750 | 1750 | if linear_path or force: |
|
1751 | 1751 | # we don't need to do any magic, just jump to the new rev |
|
1752 |
|
|
|
1752 | branch_merge = False | |
|
1753 | 1753 | p1, p2 = p2, nullid |
|
1754 | 1754 | else: |
|
1755 | 1755 | if not allow: |
@@ -1765,7 +1765,7 b' class localrepository:' | |||
|
1765 | 1765 | self.ui.status("(use update -m to merge across branches" + |
|
1766 | 1766 | " or -C to lose changes)\n") |
|
1767 | 1767 | return 1 |
|
1768 |
|
|
|
1768 | branch_merge = True | |
|
1769 | 1769 | |
|
1770 | 1770 | if moddirstate: |
|
1771 | 1771 | self.dirstate.setparents(p1, p2) |
@@ -1784,8 +1784,8 b' class localrepository:' | |||
|
1784 | 1784 | self.wfile(f, "w").write(t) |
|
1785 | 1785 | util.set_exec(self.wjoin(f), mf2[f]) |
|
1786 | 1786 | if moddirstate: |
|
1787 |
if |
|
|
1788 |
self.dirstate.update([f], 'n', st_mtime= |
|
|
1787 | if branch_merge: | |
|
1788 | self.dirstate.update([f], 'n', st_mtime=-1) | |
|
1789 | 1789 | else: |
|
1790 | 1790 | self.dirstate.update([f], 'n') |
|
1791 | 1791 | |
@@ -1794,23 +1794,22 b' class localrepository:' | |||
|
1794 | 1794 | files.sort() |
|
1795 | 1795 | for f in files: |
|
1796 | 1796 | self.ui.status("merging %s\n" % f) |
|
1797 | m, o, flag = merge[f] | |
|
1798 | self.merge3(f, m, o) | |
|
1797 | my, other, flag = merge[f] | |
|
1798 | self.merge3(f, my, other) | |
|
1799 | 1799 | util.set_exec(self.wjoin(f), flag) |
|
1800 | 1800 | if moddirstate: |
|
1801 |
if |
|
|
1802 |
# |
|
|
1803 | # could mark files with changes as unchanged | |
|
1804 |
self.dirstate.update([f], |
|
|
1805 | elif p2 == nullid: | |
|
1806 | # update dirstate from parent1's manifest | |
|
1807 | m1n = self.changelog.read(p1)[0] | |
|
1808 | m1 = self.manifest.read(m1n) | |
|
1809 | f_len = len(self.file(f).read(m1[f])) | |
|
1810 | self.dirstate.update([f], mode, st_size=f_len, st_mtime=0) | |
|
1801 | if branch_merge: | |
|
1802 | # We've done a branch merge, mark this file as merged | |
|
1803 | # so that we properly record the merger later | |
|
1804 | self.dirstate.update([f], 'm') | |
|
1811 | 1805 | else: |
|
1812 | self.ui.warn("Second parent without branch merge!?\n" | |
|
1813 | "Dirstate for file %s may be wrong.\n" % f) | |
|
1806 | # We've update-merged a locally modified file, so | |
|
1807 | # we set the dirstate to emulate a normal checkout | |
|
1808 | # of that file some time in the past. Thus our | |
|
1809 | # merge will appear as a normal local file | |
|
1810 | # modification. | |
|
1811 | f_len = len(self.file(f).read(other)) | |
|
1812 | self.dirstate.update([f], 'n', st_size=f_len, st_mtime=-1) | |
|
1814 | 1813 | |
|
1815 | 1814 | remove.sort() |
|
1816 | 1815 | for f in remove: |
@@ -1823,10 +1822,10 b' class localrepository:' | |||
|
1823 | 1822 | try: os.removedirs(os.path.dirname(self.wjoin(f))) |
|
1824 | 1823 | except: pass |
|
1825 | 1824 | if moddirstate: |
|
1826 |
if |
|
|
1825 | if branch_merge: | |
|
1826 | self.dirstate.update(remove, 'r') | |
|
1827 | else: | |
|
1827 | 1828 | self.dirstate.forget(remove) |
|
1828 | else: | |
|
1829 | self.dirstate.update(remove, 'r') | |
|
1830 | 1829 | |
|
1831 | 1830 | def merge3(self, fn, my, other): |
|
1832 | 1831 | """perform a 3-way merge in the working directory""" |
@@ -41,7 +41,7 b' hg debugstate | cut -b 1-16,35-' | |||
|
41 | 41 | |
|
42 | 42 | echo merging |
|
43 | 43 | hg pull ../a |
|
44 |
env HGMERGE=../merge hg update -vm |
|
|
44 | env HGMERGE=../merge hg update -vm | |
|
45 | 45 | |
|
46 | 46 | echo 2m > foo |
|
47 | 47 | echo 2b > baz |
@@ -55,6 +55,9 b' hg ci -m "merge" -d "0 0"' | |||
|
55 | 55 | echo "main: we should have a merge here" |
|
56 | 56 | hg debugindex .hg/00changelog.i |
|
57 | 57 | |
|
58 | echo "log should show foo and quux changed" | |
|
59 | hg log -v -r tip | |
|
60 | ||
|
58 | 61 | echo "foo: we should have a merge here" |
|
59 | 62 | hg debugindex .hg/data/foo.i |
|
60 | 63 | |
@@ -67,6 +70,9 b' hg debugindex .hg/data/baz.i' | |||
|
67 | 70 | echo "quux: we shouldn't have a merge here" |
|
68 | 71 | hg debugindex .hg/data/quux.i |
|
69 | 72 | |
|
73 | echo "manifest entries should match tips of all files" | |
|
74 | hg manifest | |
|
75 | ||
|
70 | 76 | echo "everything should be clean now" |
|
71 | 77 | hg status |
|
72 | 78 |
@@ -16,14 +16,9 b' added 1 changesets with 2 changes to 2 f' | |||
|
16 | 16 | (run 'hg update' to get a working copy) |
|
17 | 17 | merging for foo |
|
18 | 18 | resolving manifests |
|
19 | force None allow 1 moddirstate True linear False | |
|
20 | ancestor a0486579db29 local ef1b4dbe2193 remote 336d8406d617 | |
|
21 | remote bar is newer, get | |
|
22 | foo versions differ, resolve | |
|
23 | 19 | getting bar |
|
24 | 20 | merging foo |
|
25 | 21 | resolving foo |
|
26 | file foo: other 33d1fb69067a ancestor b8e02f643373 | |
|
27 | 22 | we shouldn't have anything but foo in merge state here |
|
28 | 23 | m 644 3 foo |
|
29 | 24 | main: we should have a merge here |
@@ -31,7 +26,19 b' main: we should have a merge here' | |||
|
31 | 26 | 0 0 73 0 0 cdca01651b96 000000000000 000000000000 |
|
32 | 27 | 1 73 68 1 1 f6718a9cb7f3 cdca01651b96 000000000000 |
|
33 | 28 | 2 141 68 2 2 bdd988058d16 cdca01651b96 000000000000 |
|
34 |
3 209 66 3 3 |
|
|
29 | 3 209 66 3 3 d8a521142a3c f6718a9cb7f3 bdd988058d16 | |
|
30 | log should show foo and quux changed | |
|
31 | changeset: 3:d8a521142a3c02186ee6c7254738a7e6427ed4c8 | |
|
32 | tag: tip | |
|
33 | parent: 1:f6718a9cb7f31f1a92d27bd6544c71617d6d4e4f | |
|
34 | parent: 2:bdd988058d16e2d7392958eace7b64817e44a54e | |
|
35 | user: test | |
|
36 | date: Thu Jan 1 00:00:00 1970 +0000 | |
|
37 | files: foo quux | |
|
38 | description: | |
|
39 | merge | |
|
40 | ||
|
41 | ||
|
35 | 42 | foo: we should have a merge here |
|
36 | 43 | rev offset length base linkrev nodeid p1 p2 |
|
37 | 44 | 0 0 3 0 0 b8e02f643373 000000000000 000000000000 |
@@ -50,6 +57,11 b" quux: we shouldn't have a merge here" | |||
|
50 | 57 | rev offset length base linkrev nodeid p1 p2 |
|
51 | 58 | 0 0 3 0 0 b8e02f643373 000000000000 000000000000 |
|
52 | 59 | 1 3 5 1 3 6128c0f33108 b8e02f643373 000000000000 |
|
60 | manifest entries should match tips of all files | |
|
61 | 33d1fb69067a0139622a3fa3b7ba1cdb1367972e 644 bar | |
|
62 | 2ffeddde1b65b4827f6746174a145474129fa2ce 644 baz | |
|
63 | aa27919ee4303cfd575e1fb932dd64d75aa08be4 644 foo | |
|
64 | 6128c0f33108e8cfbb4e0824d13ae48b466d7280 644 quux | |
|
53 | 65 | everything should be clean now |
|
54 | 66 | checking changesets |
|
55 | 67 | checking manifests |
@@ -6,7 +6,7 b' adding file changes' | |||
|
6 | 6 | added 1 changesets with 1 changes to 1 files |
|
7 | 7 | (run 'hg update' to get a working copy) |
|
8 | 8 | bar should remain deleted. |
|
9 | f405ac83a5611071d6b54dd5eb26943b1fdc4460 644 foo | |
|
9 | f9b0e817f6a48de3564c6b2957687c5e7297c5a0 644 foo | |
|
10 | 10 | pulling from ../A2 |
|
11 | 11 | searching for changes |
|
12 | 12 | adding changesets |
@@ -11,7 +11,7 b' summary: 2' | |||
|
11 | 11 | |
|
12 | 12 | 05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 a |
|
13 | 13 | 76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c |
|
14 |
changeset: 3: |
|
|
14 | changeset: 3:142428fbbcc5 | |
|
15 | 15 | tag: tip |
|
16 | 16 | user: test |
|
17 | 17 | date: Thu Jan 1 00:00:00 1970 +0000 |
@@ -19,7 +19,7 b' summary: 3' | |||
|
19 | 19 | |
|
20 | 20 | d6e3c4976c13feb1728cd3ac851abaf7256a5c23 644 a |
|
21 | 21 | 76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c |
|
22 | changeset: 4:8dfeee82a94b | |
|
22 | changeset: 4:4d450f9aa680 | |
|
23 | 23 | tag: tip |
|
24 | 24 | user: test |
|
25 | 25 | date: Thu Jan 1 00:00:00 1970 +0000 |
@@ -28,16 +28,16 b' summary: 4' | |||
|
28 | 28 | 05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 a |
|
29 | 29 | 54837d97f2932a8194e69745a280a2c11e61ff9c 644 b |
|
30 | 30 | 3570202ceac2b52517df64ebd0a062cb0d8fe33a 644 c |
|
31 | changeset: 4:8dfeee82a94b | |
|
31 | changeset: 4:4d450f9aa680 | |
|
32 | 32 | user: test |
|
33 | 33 | date: Thu Jan 1 00:00:00 1970 +0000 |
|
34 | 34 | summary: 4 |
|
35 | 35 | |
|
36 | 36 | d6e3c4976c13feb1728cd3ac851abaf7256a5c23 644 a |
|
37 | 37 | 76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c |
|
38 |
changeset: 6: |
|
|
38 | changeset: 6:b4b8b9afa8cc | |
|
39 | 39 | tag: tip |
|
40 | parent: 4:8dfeee82a94b | |
|
40 | parent: 4:4d450f9aa680 | |
|
41 | 41 | parent: 5:a7925a42d0df |
|
42 | 42 | user: test |
|
43 | 43 | date: Thu Jan 1 00:00:00 1970 +0000 |
@@ -45,7 +45,7 b' summary: 6' | |||
|
45 | 45 | |
|
46 | 46 | d6e3c4976c13feb1728cd3ac851abaf7256a5c23 644 a |
|
47 | 47 | 76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c |
|
48 |
changeset: 7: |
|
|
48 | changeset: 7:f84d0b1b024e | |
|
49 | 49 | tag: tip |
|
50 | 50 | user: test |
|
51 | 51 | date: Thu Jan 1 00:00:00 1970 +0000 |
General Comments 0
You need to be logged in to leave comments.
Login now