Show More
@@ -448,7 +448,7 b' class workingfilectx(filectx):' | |||||
448 |
|
448 | |||
449 | def __getattr__(self, name): |
|
449 | def __getattr__(self, name): | |
450 | if name == '_changectx': |
|
450 | if name == '_changectx': | |
451 | self._changectx = workingctx(repo) |
|
451 | self._changectx = workingctx(self._repo) | |
452 | return self._changectx |
|
452 | return self._changectx | |
453 | elif name == '_repopath': |
|
453 | elif name == '_repopath': | |
454 | self._repopath = (self._repo.dirstate.copied(self._path) |
|
454 | self._repopath = (self._repo.dirstate.copied(self._path) |
@@ -397,6 +397,10 b' class localrepository(repo.repository):' | |||||
397 | f = self.opener("branch.cache") |
|
397 | f = self.opener("branch.cache") | |
398 | lines = f.read().split('\n') |
|
398 | lines = f.read().split('\n') | |
399 | f.close() |
|
399 | f.close() | |
|
400 | except (IOError, OSError): | |||
|
401 | return {}, nullid, nullrev | |||
|
402 | ||||
|
403 | try: | |||
400 | last, lrev = lines.pop(0).split(" ", 1) |
|
404 | last, lrev = lines.pop(0).split(" ", 1) | |
401 | last, lrev = bin(last), int(lrev) |
|
405 | last, lrev = bin(last), int(lrev) | |
402 | if not (lrev < self.changelog.count() and |
|
406 | if not (lrev < self.changelog.count() and | |
@@ -422,7 +426,7 b' class localrepository(repo.repository):' | |||||
422 | for label, node in branches.iteritems(): |
|
426 | for label, node in branches.iteritems(): | |
423 | f.write("%s %s\n" % (hex(node), label)) |
|
427 | f.write("%s %s\n" % (hex(node), label)) | |
424 | f.rename() |
|
428 | f.rename() | |
425 | except IOError: |
|
429 | except (IOError, OSError): | |
426 | pass |
|
430 | pass | |
427 |
|
431 | |||
428 | def _updatebranchcache(self, partial, start, end): |
|
432 | def _updatebranchcache(self, partial, start, end): |
@@ -7,7 +7,7 b'' | |||||
7 |
|
7 | |||
8 | from node import * |
|
8 | from node import * | |
9 | from i18n import _ |
|
9 | from i18n import _ | |
10 | import errno, util, os, tempfile |
|
10 | import errno, util, os, tempfile, context | |
11 |
|
11 | |||
12 | def filemerge(repo, fw, fo, wctx, mctx): |
|
12 | def filemerge(repo, fw, fo, wctx, mctx): | |
13 | """perform a 3-way merge in the working directory |
|
13 | """perform a 3-way merge in the working directory | |
@@ -123,6 +123,14 b' def findcopies(repo, m1, m2, ma, limit):' | |||||
123 | f = dirname(f) |
|
123 | f = dirname(f) | |
124 | return d |
|
124 | return d | |
125 |
|
125 | |||
|
126 | wctx = repo.workingctx() | |||
|
127 | ||||
|
128 | def makectx(f, n): | |||
|
129 | if len(n) == 20: | |||
|
130 | return repo.filectx(f, fileid=n) | |||
|
131 | return wctx.filectx(f) | |||
|
132 | ctx = util.cachefunc(makectx) | |||
|
133 | ||||
126 | def findold(fctx): |
|
134 | def findold(fctx): | |
127 | "find files that path was copied from, back to linkrev limit" |
|
135 | "find files that path was copied from, back to linkrev limit" | |
128 | old = {} |
|
136 | old = {} | |
@@ -160,7 +168,7 b' def findcopies(repo, m1, m2, ma, limit):' | |||||
160 | # named changed on only one side? |
|
168 | # named changed on only one side? | |
161 | if ca.path() == c.path() or ca.path() == c2.path(): |
|
169 | if ca.path() == c.path() or ca.path() == c2.path(): | |
162 | fullcopy[c.path()] = of # remember for dir rename detection |
|
170 | fullcopy[c.path()] = of # remember for dir rename detection | |
163 | if c == c2: # no merge needed, ignore copy |
|
171 | if c == ca or c2 == ca: # no merge needed, ignore copy | |
164 | continue |
|
172 | continue | |
165 | copy[c.path()] = of |
|
173 | copy[c.path()] = of | |
166 |
|
174 | |||
@@ -171,13 +179,11 b' def findcopies(repo, m1, m2, ma, limit):' | |||||
171 | if not m1 or not m2 or not ma: |
|
179 | if not m1 or not m2 or not ma: | |
172 | return {} |
|
180 | return {} | |
173 |
|
181 | |||
174 | dcopies = repo.dirstate.copies() |
|
|||
175 | u1 = nonoverlap(m1, m2, ma) |
|
182 | u1 = nonoverlap(m1, m2, ma) | |
176 | u2 = nonoverlap(m2, m1, ma) |
|
183 | u2 = nonoverlap(m2, m1, ma) | |
177 | ctx = util.cachefunc(lambda f, n: repo.filectx(f, fileid=n[:20])) |
|
|||
178 |
|
184 | |||
179 | for f in u1: |
|
185 | for f in u1: | |
180 |
checkcopies(ctx( |
|
186 | checkcopies(ctx(f, m1[f]), m2) | |
181 |
|
187 | |||
182 | for f in u2: |
|
188 | for f in u2: | |
183 | checkcopies(ctx(f, m2[f]), m1) |
|
189 | checkcopies(ctx(f, m2[f]), m1) |
@@ -21,7 +21,7 b' merging zzz1_merge_ok' | |||||
21 | merging zzz1_merge_ok failed! |
|
21 | merging zzz1_merge_ok failed! | |
22 | merging zzz2_merge_bad |
|
22 | merging zzz2_merge_bad | |
23 | merging zzz2_merge_bad failed! |
|
23 | merging zzz2_merge_bad failed! | |
24 |
3 files updated, 0 files merged, |
|
24 | 3 files updated, 0 files merged, 2 files removed, 2 files unresolved | |
25 | There are unresolved merges with locally modified files. |
|
25 | There are unresolved merges with locally modified files. | |
26 | You can redo the full merge using: |
|
26 | You can redo the full merge using: | |
27 | hg update 0 |
|
27 | hg update 0 | |
@@ -40,7 +40,7 b' warning: conflicts during merge.' | |||||
40 | merging zzz1_merge_ok |
|
40 | merging zzz1_merge_ok | |
41 | merging zzz2_merge_bad |
|
41 | merging zzz2_merge_bad | |
42 | merging zzz2_merge_bad failed! |
|
42 | merging zzz2_merge_bad failed! | |
43 |
3 files updated, 1 files merged, |
|
43 | 3 files updated, 1 files merged, 2 files removed, 1 files unresolved | |
44 | There are unresolved merges with locally modified files. |
|
44 | There are unresolved merges with locally modified files. | |
45 | You can finish the partial merge using: |
|
45 | You can finish the partial merge using: | |
46 | hg update 0 |
|
46 | hg update 0 | |
@@ -59,7 +59,7 b' M zzz1_merge_ok' | |||||
59 | M zzz2_merge_bad |
|
59 | M zzz2_merge_bad | |
60 | # local merge without conflicts |
|
60 | # local merge without conflicts | |
61 | merging zzz1_merge_ok |
|
61 | merging zzz1_merge_ok | |
62 |
4 files updated, 1 files merged, |
|
62 | 4 files updated, 1 files merged, 2 files removed, 0 files unresolved | |
63 | --- a/zzz1_merge_ok |
|
63 | --- a/zzz1_merge_ok | |
64 | +++ b/zzz1_merge_ok |
|
64 | +++ b/zzz1_merge_ok | |
65 | +new last line |
|
65 | +new last line |
@@ -6,5 +6,4 b' adding manifests' | |||||
6 | adding file changes |
|
6 | adding file changes | |
7 | added 2 changesets with 2 changes to 1 files |
|
7 | added 2 changesets with 2 changes to 1 files | |
8 | (run 'hg update' to get a working copy) |
|
8 | (run 'hg update' to get a working copy) | |
9 | merging a and b |
|
9 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
10 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
@@ -10,39 +10,33 b' resolving manifests' | |||||
10 | overwrite None partial False |
|
10 | overwrite None partial False | |
11 | ancestor f9b20c0d4c51 local ce36d17b18fb+ remote 55119e611c80 |
|
11 | ancestor f9b20c0d4c51 local ce36d17b18fb+ remote 55119e611c80 | |
12 | a/c: remote renamed directory to b/c -> d |
|
12 | a/c: remote renamed directory to b/c -> d | |
13 | a/a: remote moved to b/a -> m |
|
13 | a/b: other deleted -> r | |
14 | a/b: remote moved to b/b -> m |
|
14 | a/a: other deleted -> r | |
15 | copying a/a to b/a |
|
15 | b/a: remote created -> g | |
|
16 | b/b: remote created -> g | |||
16 | removing a/a |
|
17 | removing a/a | |
17 | copying a/b to b/b |
|
|||
18 | removing a/b |
|
18 | removing a/b | |
19 | moving a/c to b/c |
|
19 | moving a/c to b/c | |
20 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
20 | getting b/a | |
|
21 | getting b/b | |||
|
22 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved | |||
21 | (branch merge, don't forget to commit) |
|
23 | (branch merge, don't forget to commit) | |
22 | a/* b/a b/b b/c |
|
24 | a/* b/a b/b b/c | |
23 | M b/a |
|
25 | M b/a | |
24 | a/a |
|
|||
25 | M b/b |
|
26 | M b/b | |
26 | a/b |
|
|||
27 | A b/c |
|
27 | A b/c | |
28 | a/c |
|
28 | a/c | |
29 | R a/a |
|
29 | R a/a | |
30 | R a/b |
|
30 | R a/b | |
31 | R a/c |
|
31 | R a/c | |
32 |
|
|
32 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
33 | resolving manifests |
|
33 | resolving manifests | |
34 | overwrite None partial False |
|
34 | overwrite None partial False | |
35 | ancestor f9b20c0d4c51 local 55119e611c80+ remote ce36d17b18fb |
|
35 | ancestor f9b20c0d4c51 local 55119e611c80+ remote ce36d17b18fb | |
36 | b/a: local moved to a/a -> m |
|
|||
37 | b/b: local moved to a/b -> m |
|
|||
38 | None: local renamed directory to b/c -> d |
|
36 | None: local renamed directory to b/c -> d | |
39 | getting a/c to b/c |
|
37 | getting a/c to b/c | |
40 |
|
|
38 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
41 | (branch merge, don't forget to commit) |
|
39 | (branch merge, don't forget to commit) | |
42 | a/* b/a b/b b/c |
|
40 | a/* b/a b/b b/c | |
43 | M b/a |
|
|||
44 | a/a |
|
|||
45 | M b/b |
|
|||
46 | a/b |
|
|||
47 | A b/c |
|
41 | A b/c | |
48 | a/c |
|
42 | a/c |
@@ -10,11 +10,9 b' adding manifests' | |||||
10 | adding file changes |
|
10 | adding file changes | |
11 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
11 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
12 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
12 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
13 | merging a/f and b/f |
|
13 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
14 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
|||
15 | (branch merge, don't forget to commit) |
|
14 | (branch merge, don't forget to commit) | |
16 | M b/f |
|
15 | M b/f | |
17 | a/f |
|
|||
18 | A b/aa/g |
|
16 | A b/aa/g | |
19 | a/aa/g |
|
17 | a/aa/g | |
20 | R a/aa/g |
|
18 | R a/aa/g |
@@ -88,15 +88,14 b' resolving manifests' | |||||
88 | overwrite None partial False |
|
88 | overwrite None partial False | |
89 | ancestor 924404dff337 local 94b33a1b7f2d+ remote 735846fee2d7 |
|
89 | ancestor 924404dff337 local 94b33a1b7f2d+ remote 735846fee2d7 | |
90 | rev: versions differ -> m |
|
90 | rev: versions differ -> m | |
91 |
|
|
91 | b: remote created -> g | |
92 | copying a to b |
|
92 | getting b | |
93 | merging rev |
|
93 | merging rev | |
94 | my rev@94b33a1b7f2d+ other rev@735846fee2d7 ancestor rev@924404dff337 |
|
94 | my rev@94b33a1b7f2d+ other rev@735846fee2d7 ancestor rev@924404dff337 | |
95 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
95 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
96 | (branch merge, don't forget to commit) |
|
96 | (branch merge, don't forget to commit) | |
97 | -------------- |
|
97 | -------------- | |
98 | M b |
|
98 | M b | |
99 | a |
|
|||
100 | C a |
|
99 | C a | |
101 | -------------- |
|
100 | -------------- | |
102 |
|
101 | |||
@@ -106,16 +105,14 b' test L:nc a b R: W: - 6 not' | |||||
106 | resolving manifests |
|
105 | resolving manifests | |
107 | overwrite None partial False |
|
106 | overwrite None partial False | |
108 | ancestor 924404dff337 local ac809aeed39a+ remote 97c705ade336 |
|
107 | ancestor 924404dff337 local ac809aeed39a+ remote 97c705ade336 | |
109 | b: local copied to a -> m |
|
|||
110 | rev: versions differ -> m |
|
108 | rev: versions differ -> m | |
111 | merging rev |
|
109 | merging rev | |
112 | my rev@ac809aeed39a+ other rev@97c705ade336 ancestor rev@924404dff337 |
|
110 | my rev@ac809aeed39a+ other rev@97c705ade336 ancestor rev@924404dff337 | |
113 |
|
|
111 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
114 | (branch merge, don't forget to commit) |
|
112 | (branch merge, don't forget to commit) | |
115 | -------------- |
|
113 | -------------- | |
116 | M b |
|
|||
117 | a |
|
|||
118 | C a |
|
114 | C a | |
|
115 | C b | |||
119 | -------------- |
|
116 | -------------- | |
120 |
|
117 | |||
121 | -------------- |
|
118 | -------------- | |
@@ -124,17 +121,17 b' test L: R:nm a b W: - 7 get' | |||||
124 | resolving manifests |
|
121 | resolving manifests | |
125 | overwrite None partial False |
|
122 | overwrite None partial False | |
126 | ancestor 924404dff337 local 94b33a1b7f2d+ remote e03727d2d66b |
|
123 | ancestor 924404dff337 local 94b33a1b7f2d+ remote e03727d2d66b | |
|
124 | a: other deleted -> r | |||
127 | rev: versions differ -> m |
|
125 | rev: versions differ -> m | |
128 |
|
|
126 | b: remote created -> g | |
129 | copying a to b |
|
|||
130 | removing a |
|
127 | removing a | |
|
128 | getting b | |||
131 | merging rev |
|
129 | merging rev | |
132 | my rev@94b33a1b7f2d+ other rev@e03727d2d66b ancestor rev@924404dff337 |
|
130 | my rev@94b33a1b7f2d+ other rev@e03727d2d66b ancestor rev@924404dff337 | |
133 |
1 files updated, 1 files merged, |
|
131 | 1 files updated, 1 files merged, 1 files removed, 0 files unresolved | |
134 | (branch merge, don't forget to commit) |
|
132 | (branch merge, don't forget to commit) | |
135 | -------------- |
|
133 | -------------- | |
136 | M b |
|
134 | M b | |
137 | a |
|
|||
138 | -------------- |
|
135 | -------------- | |
139 |
|
136 | |||
140 | -------------- |
|
137 | -------------- | |
@@ -143,15 +140,13 b' test L:nm a b R: W: - 8 not' | |||||
143 | resolving manifests |
|
140 | resolving manifests | |
144 | overwrite None partial False |
|
141 | overwrite None partial False | |
145 | ancestor 924404dff337 local ecf3cb2a4219+ remote 97c705ade336 |
|
142 | ancestor 924404dff337 local ecf3cb2a4219+ remote 97c705ade336 | |
146 | b: local moved to a -> m |
|
|||
147 | rev: versions differ -> m |
|
143 | rev: versions differ -> m | |
148 | merging rev |
|
144 | merging rev | |
149 | my rev@ecf3cb2a4219+ other rev@97c705ade336 ancestor rev@924404dff337 |
|
145 | my rev@ecf3cb2a4219+ other rev@97c705ade336 ancestor rev@924404dff337 | |
150 |
|
|
146 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
151 | (branch merge, don't forget to commit) |
|
147 | (branch merge, don't forget to commit) | |
152 | -------------- |
|
148 | -------------- | |
153 |
|
|
149 | C b | |
154 | a |
|
|||
155 | -------------- |
|
150 | -------------- | |
156 |
|
151 | |||
157 | -------------- |
|
152 | -------------- |
General Comments 0
You need to be logged in to leave comments.
Login now