Show More
@@ -1,193 +1,193 b'' | |||||
1 | # copies.py - copy detection for Mercurial |
|
1 | # copies.py - copy detection for Mercurial | |
2 | # |
|
2 | # | |
3 | # Copyright 2008 Matt Mackall <mpm@selenic.com> |
|
3 | # Copyright 2008 Matt Mackall <mpm@selenic.com> | |
4 | # |
|
4 | # | |
5 | # This software may be used and distributed according to the terms |
|
5 | # This software may be used and distributed according to the terms | |
6 | # of the GNU General Public License, incorporated herein by reference. |
|
6 | # of the GNU General Public License, incorporated herein by reference. | |
7 |
|
7 | |||
8 | from node import nullid, nullrev |
|
8 | from node import nullid, nullrev | |
9 | from i18n import _ |
|
9 | from i18n import _ | |
10 | import util, ancestor |
|
10 | import util, ancestor | |
11 |
|
11 | |||
12 | def _nonoverlap(d1, d2, d3): |
|
12 | def _nonoverlap(d1, d2, d3): | |
13 | "Return list of elements in d1 not in d2 or d3" |
|
13 | "Return list of elements in d1 not in d2 or d3" | |
14 | l = [d for d in d1 if d not in d3 and d not in d2] |
|
14 | l = [d for d in d1 if d not in d3 and d not in d2] | |
15 | l.sort() |
|
15 | l.sort() | |
16 | return l |
|
16 | return l | |
17 |
|
17 | |||
18 | def _dirname(f): |
|
18 | def _dirname(f): | |
19 | s = f.rfind("/") |
|
19 | s = f.rfind("/") | |
20 | if s == -1: |
|
20 | if s == -1: | |
21 | return "" |
|
21 | return "" | |
22 | return f[:s] |
|
22 | return f[:s] | |
23 |
|
23 | |||
24 | def _dirs(files): |
|
24 | def _dirs(files): | |
25 | d = {} |
|
25 | d = {} | |
26 | for f in files: |
|
26 | for f in files: | |
27 | f = _dirname(f) |
|
27 | f = _dirname(f) | |
28 | while f not in d: |
|
28 | while f not in d: | |
29 | d[f] = True |
|
29 | d[f] = True | |
30 | f = _dirname(f) |
|
30 | f = _dirname(f) | |
31 | return d |
|
31 | return d | |
32 |
|
32 | |||
33 | def _findoldnames(fctx, limit): |
|
33 | def _findoldnames(fctx, limit): | |
34 | "find files that path was copied from, back to linkrev limit" |
|
34 | "find files that path was copied from, back to linkrev limit" | |
35 | old = {} |
|
35 | old = {} | |
36 | seen = {} |
|
36 | seen = {} | |
37 | orig = fctx.path() |
|
37 | orig = fctx.path() | |
38 | visit = [fctx] |
|
38 | visit = [fctx] | |
39 | while visit: |
|
39 | while visit: | |
40 | fc = visit.pop() |
|
40 | fc = visit.pop() | |
41 | s = str(fc) |
|
41 | s = str(fc) | |
42 | if s in seen: |
|
42 | if s in seen: | |
43 | continue |
|
43 | continue | |
44 | seen[s] = 1 |
|
44 | seen[s] = 1 | |
45 | if fc.path() != orig and fc.path() not in old: |
|
45 | if fc.path() != orig and fc.path() not in old: | |
46 | old[fc.path()] = 1 |
|
46 | old[fc.path()] = 1 | |
47 | if fc.rev() < limit and fc.rev() is not None: |
|
47 | if fc.rev() < limit and fc.rev() is not None: | |
48 | continue |
|
48 | continue | |
49 | visit += fc.parents() |
|
49 | visit += fc.parents() | |
50 |
|
50 | |||
51 | old = old.keys() |
|
51 | old = old.keys() | |
52 | old.sort() |
|
52 | old.sort() | |
53 | return old |
|
53 | return old | |
54 |
|
54 | |||
55 | def copies(repo, c1, c2, ca): |
|
55 | def copies(repo, c1, c2, ca): | |
56 | """ |
|
56 | """ | |
57 | Find moves and copies between context c1 and c2 |
|
57 | Find moves and copies between context c1 and c2 | |
58 | """ |
|
58 | """ | |
59 | # avoid silly behavior for update from empty dir |
|
59 | # avoid silly behavior for update from empty dir | |
60 | if not c1 or not c2: |
|
60 | if not c1 or not c2: | |
61 | return {}, {} |
|
61 | return {}, {} | |
62 |
|
62 | |||
63 | rev1, rev2 = c1.rev(), c2.rev() |
|
63 | rev1, rev2 = c1.rev(), c2.rev() | |
64 | if rev1 is None: # c1 is a workingctx |
|
64 | if rev1 is None: # c1 is a workingctx | |
65 | rev1 = c1.parents()[0].rev() |
|
65 | rev1 = c1.parents()[0].rev() | |
66 | if rev2 is None: # c2 is a workingctx |
|
66 | if rev2 is None: # c2 is a workingctx | |
67 | rev2 = c2.parents()[0].rev() |
|
67 | rev2 = c2.parents()[0].rev() | |
68 | pr = repo.changelog.parentrevs |
|
68 | pr = repo.changelog.parentrevs | |
69 | def parents(rev): |
|
69 | def parents(rev): | |
70 | return [p for p in pr(rev) if p != nullrev] |
|
70 | return [p for p in pr(rev) if p != nullrev] | |
71 |
limit = min(ancestor.symmetricdifference(rev1, rev2, parents) |
|
71 | limit = min(ancestor.symmetricdifference(rev1, rev2, parents)) | |
72 | m1 = c1.manifest() |
|
72 | m1 = c1.manifest() | |
73 | m2 = c2.manifest() |
|
73 | m2 = c2.manifest() | |
74 | ma = ca.manifest() |
|
74 | ma = ca.manifest() | |
75 |
|
75 | |||
76 | def makectx(f, n): |
|
76 | def makectx(f, n): | |
77 | if len(n) != 20: # in a working context? |
|
77 | if len(n) != 20: # in a working context? | |
78 | if c1.rev() is None: |
|
78 | if c1.rev() is None: | |
79 | return c1.filectx(f) |
|
79 | return c1.filectx(f) | |
80 | return c2.filectx(f) |
|
80 | return c2.filectx(f) | |
81 | return repo.filectx(f, fileid=n) |
|
81 | return repo.filectx(f, fileid=n) | |
82 | ctx = util.cachefunc(makectx) |
|
82 | ctx = util.cachefunc(makectx) | |
83 |
|
83 | |||
84 | copy = {} |
|
84 | copy = {} | |
85 | fullcopy = {} |
|
85 | fullcopy = {} | |
86 | diverge = {} |
|
86 | diverge = {} | |
87 |
|
87 | |||
88 | def checkcopies(f, m1, m2): |
|
88 | def checkcopies(f, m1, m2): | |
89 | '''check possible copies of f from m1 to m2''' |
|
89 | '''check possible copies of f from m1 to m2''' | |
90 | c1 = ctx(f, m1[f]) |
|
90 | c1 = ctx(f, m1[f]) | |
91 | for of in _findoldnames(c1, limit): |
|
91 | for of in _findoldnames(c1, limit): | |
92 | fullcopy[f] = of # remember for dir rename detection |
|
92 | fullcopy[f] = of # remember for dir rename detection | |
93 | if of in m2: # original file not in other manifest? |
|
93 | if of in m2: # original file not in other manifest? | |
94 | # if the original file is unchanged on the other branch, |
|
94 | # if the original file is unchanged on the other branch, | |
95 | # no merge needed |
|
95 | # no merge needed | |
96 | if m2[of] != ma.get(of): |
|
96 | if m2[of] != ma.get(of): | |
97 | c2 = ctx(of, m2[of]) |
|
97 | c2 = ctx(of, m2[of]) | |
98 | ca = c1.ancestor(c2) |
|
98 | ca = c1.ancestor(c2) | |
99 | # related and named changed on only one side? |
|
99 | # related and named changed on only one side? | |
100 | if ca and ca.path() == f or ca.path() == c2.path(): |
|
100 | if ca and ca.path() == f or ca.path() == c2.path(): | |
101 | if c1 != ca or c2 != ca: # merge needed? |
|
101 | if c1 != ca or c2 != ca: # merge needed? | |
102 | copy[f] = of |
|
102 | copy[f] = of | |
103 | elif of in ma: |
|
103 | elif of in ma: | |
104 | diverge.setdefault(of, []).append(f) |
|
104 | diverge.setdefault(of, []).append(f) | |
105 |
|
105 | |||
106 | if not repo.ui.configbool("merge", "followcopies", True): |
|
106 | if not repo.ui.configbool("merge", "followcopies", True): | |
107 | return {}, {} |
|
107 | return {}, {} | |
108 |
|
108 | |||
109 | repo.ui.debug(_(" searching for copies back to rev %d\n") % limit) |
|
109 | repo.ui.debug(_(" searching for copies back to rev %d\n") % limit) | |
110 |
|
110 | |||
111 | u1 = _nonoverlap(m1, m2, ma) |
|
111 | u1 = _nonoverlap(m1, m2, ma) | |
112 | u2 = _nonoverlap(m2, m1, ma) |
|
112 | u2 = _nonoverlap(m2, m1, ma) | |
113 |
|
113 | |||
114 | if u1: |
|
114 | if u1: | |
115 | repo.ui.debug(_(" unmatched files in local:\n %s\n") |
|
115 | repo.ui.debug(_(" unmatched files in local:\n %s\n") | |
116 | % "\n ".join(u1)) |
|
116 | % "\n ".join(u1)) | |
117 | if u2: |
|
117 | if u2: | |
118 | repo.ui.debug(_(" unmatched files in other:\n %s\n") |
|
118 | repo.ui.debug(_(" unmatched files in other:\n %s\n") | |
119 | % "\n ".join(u2)) |
|
119 | % "\n ".join(u2)) | |
120 |
|
120 | |||
121 | for f in u1: |
|
121 | for f in u1: | |
122 | checkcopies(f, m1, m2) |
|
122 | checkcopies(f, m1, m2) | |
123 | for f in u2: |
|
123 | for f in u2: | |
124 | checkcopies(f, m2, m1) |
|
124 | checkcopies(f, m2, m1) | |
125 |
|
125 | |||
126 | diverge2 = {} |
|
126 | diverge2 = {} | |
127 | for of, fl in diverge.items(): |
|
127 | for of, fl in diverge.items(): | |
128 | if len(fl) == 1: |
|
128 | if len(fl) == 1: | |
129 | del diverge[of] # not actually divergent |
|
129 | del diverge[of] # not actually divergent | |
130 | else: |
|
130 | else: | |
131 | diverge2.update(dict.fromkeys(fl)) # reverse map for below |
|
131 | diverge2.update(dict.fromkeys(fl)) # reverse map for below | |
132 |
|
132 | |||
133 | if fullcopy: |
|
133 | if fullcopy: | |
134 | repo.ui.debug(_(" all copies found (* = to merge, ! = divergent):\n")) |
|
134 | repo.ui.debug(_(" all copies found (* = to merge, ! = divergent):\n")) | |
135 | for f in fullcopy: |
|
135 | for f in fullcopy: | |
136 | note = "" |
|
136 | note = "" | |
137 | if f in copy: note += "*" |
|
137 | if f in copy: note += "*" | |
138 | if f in diverge2: note += "!" |
|
138 | if f in diverge2: note += "!" | |
139 | repo.ui.debug(_(" %s -> %s %s\n") % (f, fullcopy[f], note)) |
|
139 | repo.ui.debug(_(" %s -> %s %s\n") % (f, fullcopy[f], note)) | |
140 | del diverge2 |
|
140 | del diverge2 | |
141 |
|
141 | |||
142 | if not fullcopy or not repo.ui.configbool("merge", "followdirs", True): |
|
142 | if not fullcopy or not repo.ui.configbool("merge", "followdirs", True): | |
143 | return copy, diverge |
|
143 | return copy, diverge | |
144 |
|
144 | |||
145 | repo.ui.debug(_(" checking for directory renames\n")) |
|
145 | repo.ui.debug(_(" checking for directory renames\n")) | |
146 |
|
146 | |||
147 | # generate a directory move map |
|
147 | # generate a directory move map | |
148 | d1, d2 = _dirs(m1), _dirs(m2) |
|
148 | d1, d2 = _dirs(m1), _dirs(m2) | |
149 | invalid = {} |
|
149 | invalid = {} | |
150 | dirmove = {} |
|
150 | dirmove = {} | |
151 |
|
151 | |||
152 | # examine each file copy for a potential directory move, which is |
|
152 | # examine each file copy for a potential directory move, which is | |
153 | # when all the files in a directory are moved to a new directory |
|
153 | # when all the files in a directory are moved to a new directory | |
154 | for dst, src in fullcopy.items(): |
|
154 | for dst, src in fullcopy.items(): | |
155 | dsrc, ddst = _dirname(src), _dirname(dst) |
|
155 | dsrc, ddst = _dirname(src), _dirname(dst) | |
156 | if dsrc in invalid: |
|
156 | if dsrc in invalid: | |
157 | # already seen to be uninteresting |
|
157 | # already seen to be uninteresting | |
158 | continue |
|
158 | continue | |
159 | elif dsrc in d1 and ddst in d1: |
|
159 | elif dsrc in d1 and ddst in d1: | |
160 | # directory wasn't entirely moved locally |
|
160 | # directory wasn't entirely moved locally | |
161 | invalid[dsrc] = True |
|
161 | invalid[dsrc] = True | |
162 | elif dsrc in d2 and ddst in d2: |
|
162 | elif dsrc in d2 and ddst in d2: | |
163 | # directory wasn't entirely moved remotely |
|
163 | # directory wasn't entirely moved remotely | |
164 | invalid[dsrc] = True |
|
164 | invalid[dsrc] = True | |
165 | elif dsrc in dirmove and dirmove[dsrc] != ddst: |
|
165 | elif dsrc in dirmove and dirmove[dsrc] != ddst: | |
166 | # files from the same directory moved to two different places |
|
166 | # files from the same directory moved to two different places | |
167 | invalid[dsrc] = True |
|
167 | invalid[dsrc] = True | |
168 | else: |
|
168 | else: | |
169 | # looks good so far |
|
169 | # looks good so far | |
170 | dirmove[dsrc + "/"] = ddst + "/" |
|
170 | dirmove[dsrc + "/"] = ddst + "/" | |
171 |
|
171 | |||
172 | for i in invalid: |
|
172 | for i in invalid: | |
173 | if i in dirmove: |
|
173 | if i in dirmove: | |
174 | del dirmove[i] |
|
174 | del dirmove[i] | |
175 | del d1, d2, invalid |
|
175 | del d1, d2, invalid | |
176 |
|
176 | |||
177 | if not dirmove: |
|
177 | if not dirmove: | |
178 | return copy, diverge |
|
178 | return copy, diverge | |
179 |
|
179 | |||
180 | for d in dirmove: |
|
180 | for d in dirmove: | |
181 | repo.ui.debug(_(" dir %s -> %s\n") % (d, dirmove[d])) |
|
181 | repo.ui.debug(_(" dir %s -> %s\n") % (d, dirmove[d])) | |
182 |
|
182 | |||
183 | # check unaccounted nonoverlapping files against directory moves |
|
183 | # check unaccounted nonoverlapping files against directory moves | |
184 | for f in u1 + u2: |
|
184 | for f in u1 + u2: | |
185 | if f not in fullcopy: |
|
185 | if f not in fullcopy: | |
186 | for d in dirmove: |
|
186 | for d in dirmove: | |
187 | if f.startswith(d): |
|
187 | if f.startswith(d): | |
188 | # new file added in a directory that was moved, move it |
|
188 | # new file added in a directory that was moved, move it | |
189 | copy[f] = dirmove[d] + f[len(d):] |
|
189 | copy[f] = dirmove[d] + f[len(d):] | |
190 | repo.ui.debug(_(" file %s -> %s\n") % (f, copy[f])) |
|
190 | repo.ui.debug(_(" file %s -> %s\n") % (f, copy[f])) | |
191 | break |
|
191 | break | |
192 |
|
192 | |||
193 | return copy, diverge |
|
193 | return copy, diverge |
@@ -1,203 +1,197 b'' | |||||
1 | adding start |
|
1 | adding start | |
2 | adding new |
|
2 | adding new | |
3 | % new file |
|
3 | % new file | |
4 | diff --git a/new b/new |
|
4 | diff --git a/new b/new | |
5 | new file mode 100644 |
|
5 | new file mode 100644 | |
6 | --- /dev/null |
|
6 | --- /dev/null | |
7 | +++ b/new |
|
7 | +++ b/new | |
8 | @@ -0,0 +1,1 @@ |
|
8 | @@ -0,0 +1,1 @@ | |
9 | +new |
|
9 | +new | |
10 | % copy |
|
10 | % copy | |
11 | diff --git a/new b/copy |
|
11 | diff --git a/new b/copy | |
12 | copy from new |
|
12 | copy from new | |
13 | copy to copy |
|
13 | copy to copy | |
14 | % rename |
|
14 | % rename | |
15 |
diff --git a/copy b/ |
|
15 | diff --git a/copy b/rename | |
16 | deleted file mode 100644 |
|
16 | rename from copy | |
17 | --- a/copy |
|
17 | rename to rename | |
18 | +++ /dev/null |
|
|||
19 | @@ -1,1 +0,0 @@ |
|
|||
20 | -new |
|
|||
21 | diff --git a/new b/rename |
|
|||
22 | copy from new |
|
|||
23 | copy to rename |
|
|||
24 | % delete |
|
18 | % delete | |
25 | diff --git a/rename b/rename |
|
19 | diff --git a/rename b/rename | |
26 | deleted file mode 100644 |
|
20 | deleted file mode 100644 | |
27 | --- a/rename |
|
21 | --- a/rename | |
28 | +++ /dev/null |
|
22 | +++ /dev/null | |
29 | @@ -1,1 +0,0 @@ |
|
23 | @@ -1,1 +0,0 @@ | |
30 | -new |
|
24 | -new | |
31 | adding src |
|
25 | adding src | |
32 | % chmod 644 |
|
26 | % chmod 644 | |
33 | diff --git a/src b/src |
|
27 | diff --git a/src b/src | |
34 | old mode 100644 |
|
28 | old mode 100644 | |
35 | new mode 100755 |
|
29 | new mode 100755 | |
36 | % rename+mod+chmod |
|
30 | % rename+mod+chmod | |
37 | diff --git a/src b/dst |
|
31 | diff --git a/src b/dst | |
38 | old mode 100755 |
|
32 | old mode 100755 | |
39 | new mode 100644 |
|
33 | new mode 100644 | |
40 | rename from src |
|
34 | rename from src | |
41 | rename to dst |
|
35 | rename to dst | |
42 | --- a/src |
|
36 | --- a/src | |
43 | +++ b/dst |
|
37 | +++ b/dst | |
44 | @@ -3,3 +3,4 @@ |
|
38 | @@ -3,3 +3,4 @@ | |
45 | 3 |
|
39 | 3 | |
46 | 4 |
|
40 | 4 | |
47 | 5 |
|
41 | 5 | |
48 | +a |
|
42 | +a | |
49 | % nonexistent in tip+chmod |
|
43 | % nonexistent in tip+chmod | |
50 | diff --git a/src b/src |
|
44 | diff --git a/src b/src | |
51 | old mode 100644 |
|
45 | old mode 100644 | |
52 | new mode 100755 |
|
46 | new mode 100755 | |
53 | % binary diff |
|
47 | % binary diff | |
54 | diff --git a/binfile.bin b/binfile.bin |
|
48 | diff --git a/binfile.bin b/binfile.bin | |
55 | new file mode 100644 |
|
49 | new file mode 100644 | |
56 | index 0000000000000000000000000000000000000000..37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9 |
|
50 | index 0000000000000000000000000000000000000000..37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9 | |
57 | GIT binary patch |
|
51 | GIT binary patch | |
58 | literal 593 |
|
52 | literal 593 | |
59 | zc$@)I0<QguP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU |
|
53 | zc$@)I0<QguP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU | |
60 | z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd |
|
54 | z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd | |
61 | zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M |
|
55 | zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M | |
62 | z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT |
|
56 | z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT | |
63 | zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po |
|
57 | zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po | |
64 | ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<; |
|
58 | ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<; | |
65 | zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V |
|
59 | zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V | |
66 | z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W- |
|
60 | z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W- | |
67 | zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U; |
|
61 | zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U; | |
68 | z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K |
|
62 | z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K | |
69 | zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#= |
|
63 | zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#= | |
70 | fQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf{mKw4 |
|
64 | fQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf{mKw4 | |
71 |
|
65 | |||
72 | % import binary diff |
|
66 | % import binary diff | |
73 | applying b.diff |
|
67 | applying b.diff | |
74 |
|
68 | |||
75 | % rename binary file |
|
69 | % rename binary file | |
76 | diff --git a/binfile.bin b/renamed.bin |
|
70 | diff --git a/binfile.bin b/renamed.bin | |
77 | rename from binfile.bin |
|
71 | rename from binfile.bin | |
78 | rename to renamed.bin |
|
72 | rename to renamed.bin | |
79 |
|
73 | |||
80 | % diff across many revisions |
|
74 | % diff across many revisions | |
81 | diff --git a/dst2 b/dst3 |
|
75 | diff --git a/dst2 b/dst3 | |
82 | rename from dst2 |
|
76 | rename from dst2 | |
83 | rename to dst3 |
|
77 | rename to dst3 | |
84 | % reversed |
|
78 | % reversed | |
85 | diff --git a/dst3 b/dst2 |
|
79 | diff --git a/dst3 b/dst2 | |
86 | rename from dst3 |
|
80 | rename from dst3 | |
87 | rename to dst2 |
|
81 | rename to dst2 | |
88 |
|
82 | |||
89 | % file created before r1 and renamed before r2 |
|
83 | % file created before r1 and renamed before r2 | |
90 | diff --git a/foo b/bar |
|
84 | diff --git a/foo b/bar | |
91 | rename from foo |
|
85 | rename from foo | |
92 | rename to bar |
|
86 | rename to bar | |
93 | --- a/foo |
|
87 | --- a/foo | |
94 | +++ b/bar |
|
88 | +++ b/bar | |
95 | @@ -1,2 +1,3 @@ |
|
89 | @@ -1,2 +1,3 @@ | |
96 | a |
|
90 | a | |
97 | b |
|
91 | b | |
98 | +c |
|
92 | +c | |
99 | % reversed |
|
93 | % reversed | |
100 | diff --git a/bar b/foo |
|
94 | diff --git a/bar b/foo | |
101 | rename from bar |
|
95 | rename from bar | |
102 | rename to foo |
|
96 | rename to foo | |
103 | --- a/bar |
|
97 | --- a/bar | |
104 | +++ b/foo |
|
98 | +++ b/foo | |
105 | @@ -1,3 +1,2 @@ |
|
99 | @@ -1,3 +1,2 @@ | |
106 | a |
|
100 | a | |
107 | b |
|
101 | b | |
108 | -c |
|
102 | -c | |
109 |
|
103 | |||
110 | % file created in r1 and renamed before r2 |
|
104 | % file created in r1 and renamed before r2 | |
111 | diff --git a/foo b/bar |
|
105 | diff --git a/foo b/bar | |
112 | rename from foo |
|
106 | rename from foo | |
113 | rename to bar |
|
107 | rename to bar | |
114 | --- a/foo |
|
108 | --- a/foo | |
115 | +++ b/bar |
|
109 | +++ b/bar | |
116 | @@ -1,1 +1,3 @@ |
|
110 | @@ -1,1 +1,3 @@ | |
117 | a |
|
111 | a | |
118 | +b |
|
112 | +b | |
119 | +c |
|
113 | +c | |
120 | % reversed |
|
114 | % reversed | |
121 | diff --git a/bar b/foo |
|
115 | diff --git a/bar b/foo | |
122 | rename from bar |
|
116 | rename from bar | |
123 | rename to foo |
|
117 | rename to foo | |
124 | --- a/bar |
|
118 | --- a/bar | |
125 | +++ b/foo |
|
119 | +++ b/foo | |
126 | @@ -1,3 +1,1 @@ |
|
120 | @@ -1,3 +1,1 @@ | |
127 | a |
|
121 | a | |
128 | -b |
|
122 | -b | |
129 | -c |
|
123 | -c | |
130 |
|
124 | |||
131 | % file created after r1 and renamed before r2 |
|
125 | % file created after r1 and renamed before r2 | |
132 | diff --git a/bar b/bar |
|
126 | diff --git a/bar b/bar | |
133 | new file mode 100644 |
|
127 | new file mode 100644 | |
134 | --- /dev/null |
|
128 | --- /dev/null | |
135 | +++ b/bar |
|
129 | +++ b/bar | |
136 | @@ -0,0 +1,3 @@ |
|
130 | @@ -0,0 +1,3 @@ | |
137 | +a |
|
131 | +a | |
138 | +b |
|
132 | +b | |
139 | +c |
|
133 | +c | |
140 | % reversed |
|
134 | % reversed | |
141 | diff --git a/bar b/bar |
|
135 | diff --git a/bar b/bar | |
142 | deleted file mode 100644 |
|
136 | deleted file mode 100644 | |
143 | --- a/bar |
|
137 | --- a/bar | |
144 | +++ /dev/null |
|
138 | +++ /dev/null | |
145 | @@ -1,3 +0,0 @@ |
|
139 | @@ -1,3 +0,0 @@ | |
146 | -a |
|
140 | -a | |
147 | -b |
|
141 | -b | |
148 | -c |
|
142 | -c | |
149 |
|
143 | |||
150 | % comparing with the working dir |
|
144 | % comparing with the working dir | |
151 | % there's a copy in the working dir... |
|
145 | % there's a copy in the working dir... | |
152 | diff --git a/created2 b/created3 |
|
146 | diff --git a/created2 b/created3 | |
153 | rename from created2 |
|
147 | rename from created2 | |
154 | rename to created3 |
|
148 | rename to created3 | |
155 |
|
149 | |||
156 | % ...but there's another copy between the original rev and the wd |
|
150 | % ...but there's another copy between the original rev and the wd | |
157 | diff --git a/created b/created3 |
|
151 | diff --git a/created b/created3 | |
158 | rename from created |
|
152 | rename from created | |
159 | rename to created3 |
|
153 | rename to created3 | |
160 |
|
154 | |||
161 | % ...but the source of the copy was created after the original rev |
|
155 | % ...but the source of the copy was created after the original rev | |
162 | diff --git a/created3 b/created3 |
|
156 | diff --git a/created3 b/created3 | |
163 | new file mode 100644 |
|
157 | new file mode 100644 | |
164 | --- /dev/null |
|
158 | --- /dev/null | |
165 | +++ b/created3 |
|
159 | +++ b/created3 | |
166 | @@ -0,0 +1,1 @@ |
|
160 | @@ -0,0 +1,1 @@ | |
167 | + |
|
161 | + | |
168 | % created in parent of wd; renamed in the wd |
|
162 | % created in parent of wd; renamed in the wd | |
169 | diff --git a/brand-new b/brand-new2 |
|
163 | diff --git a/brand-new b/brand-new2 | |
170 | rename from brand-new |
|
164 | rename from brand-new | |
171 | rename to brand-new2 |
|
165 | rename to brand-new2 | |
172 |
|
166 | |||
173 | % created between r1 and parent of wd; renamed in the wd |
|
167 | % created between r1 and parent of wd; renamed in the wd | |
174 | diff --git a/brand-new2 b/brand-new2 |
|
168 | diff --git a/brand-new2 b/brand-new2 | |
175 | new file mode 100644 |
|
169 | new file mode 100644 | |
176 | --- /dev/null |
|
170 | --- /dev/null | |
177 | +++ b/brand-new2 |
|
171 | +++ b/brand-new2 | |
178 | @@ -0,0 +1,1 @@ |
|
172 | @@ -0,0 +1,1 @@ | |
179 | + |
|
173 | + | |
180 | % one file is copied to many destinations and removed |
|
174 | % one file is copied to many destinations and removed | |
181 | diff --git a/brand-new2 b/brand-new3 |
|
175 | diff --git a/brand-new2 b/brand-new3 | |
182 | rename from brand-new2 |
|
176 | rename from brand-new2 | |
183 | rename to brand-new3 |
|
177 | rename to brand-new3 | |
184 | diff --git a/brand-new2 b/brand-new3-2 |
|
178 | diff --git a/brand-new2 b/brand-new3-2 | |
185 | copy from brand-new2 |
|
179 | copy from brand-new2 | |
186 | copy to brand-new3-2 |
|
180 | copy to brand-new3-2 | |
187 | % reversed |
|
181 | % reversed | |
188 | diff --git a/brand-new3 b/brand-new2 |
|
182 | diff --git a/brand-new3 b/brand-new2 | |
189 | rename from brand-new3 |
|
183 | rename from brand-new3 | |
190 | rename to brand-new2 |
|
184 | rename to brand-new2 | |
191 | diff --git a/brand-new3-2 b/brand-new3-2 |
|
185 | diff --git a/brand-new3-2 b/brand-new3-2 | |
192 | deleted file mode 100644 |
|
186 | deleted file mode 100644 | |
193 | --- a/brand-new3-2 |
|
187 | --- a/brand-new3-2 | |
194 | +++ /dev/null |
|
188 | +++ /dev/null | |
195 | @@ -1,1 +0,0 @@ |
|
189 | @@ -1,1 +0,0 @@ | |
196 | - |
|
190 | - | |
197 | % there should be a trailing TAB if there are spaces in the file name |
|
191 | % there should be a trailing TAB if there are spaces in the file name | |
198 | diff --git a/with spaces b/with spaces |
|
192 | diff --git a/with spaces b/with spaces | |
199 | new file mode 100644 |
|
193 | new file mode 100644 | |
200 | --- /dev/null |
|
194 | --- /dev/null | |
201 | +++ b/with spaces |
|
195 | +++ b/with spaces | |
202 | @@ -0,0 +1,1 @@ |
|
196 | @@ -0,0 +1,1 @@ | |
203 | +foo |
|
197 | +foo |
@@ -1,147 +1,147 b'' | |||||
1 | adding a |
|
1 | adding a | |
2 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
2 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
3 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
3 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
4 | diff -r 33aaa84a386b a |
|
4 | diff -r 33aaa84a386b a | |
5 | --- a/a |
|
5 | --- a/a | |
6 | +++ b/a |
|
6 | +++ b/a | |
7 | @@ -1,1 +1,1 @@ |
|
7 | @@ -1,1 +1,1 @@ | |
8 | -a |
|
8 | -a | |
9 | +abc |
|
9 | +abc | |
10 | adding b |
|
10 | adding b | |
11 | M a |
|
11 | M a | |
12 | changeset: 0:33aaa84a386b |
|
12 | changeset: 0:33aaa84a386b | |
13 | user: test |
|
13 | user: test | |
14 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
14 | date: Mon Jan 12 13:46:40 1970 +0000 | |
15 | summary: 1 |
|
15 | summary: 1 | |
16 |
|
16 | |||
17 | resolving manifests |
|
17 | resolving manifests | |
18 | overwrite False partial False |
|
18 | overwrite False partial False | |
19 | ancestor 33aaa84a386b local 33aaa84a386b+ remote 802f095af299 |
|
19 | ancestor 33aaa84a386b local 33aaa84a386b+ remote 802f095af299 | |
20 |
searching for copies back to rev |
|
20 | searching for copies back to rev 1 | |
21 | unmatched files in other: |
|
21 | unmatched files in other: | |
22 | b |
|
22 | b | |
23 | a: versions differ -> m |
|
23 | a: versions differ -> m | |
24 | b: remote created -> g |
|
24 | b: remote created -> g | |
25 | picked tool 'true' for a (binary False symlink False) |
|
25 | picked tool 'true' for a (binary False symlink False) | |
26 | merging a |
|
26 | merging a | |
27 | my a@33aaa84a386b+ other a@802f095af299 ancestor a@33aaa84a386b |
|
27 | my a@33aaa84a386b+ other a@802f095af299 ancestor a@33aaa84a386b | |
28 | getting b |
|
28 | getting b | |
29 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
29 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
30 | changeset: 1:802f095af299 |
|
30 | changeset: 1:802f095af299 | |
31 | tag: tip |
|
31 | tag: tip | |
32 | user: test |
|
32 | user: test | |
33 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
33 | date: Mon Jan 12 13:46:40 1970 +0000 | |
34 | summary: 2 |
|
34 | summary: 2 | |
35 |
|
35 | |||
36 | resolving manifests |
|
36 | resolving manifests | |
37 | overwrite False partial False |
|
37 | overwrite False partial False | |
38 | ancestor 33aaa84a386b local 802f095af299+ remote 33aaa84a386b |
|
38 | ancestor 33aaa84a386b local 802f095af299+ remote 33aaa84a386b | |
39 | b: remote deleted -> r |
|
39 | b: remote deleted -> r | |
40 | removing b |
|
40 | removing b | |
41 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
41 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
42 | changeset: 0:33aaa84a386b |
|
42 | changeset: 0:33aaa84a386b | |
43 | user: test |
|
43 | user: test | |
44 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
44 | date: Mon Jan 12 13:46:40 1970 +0000 | |
45 | summary: 1 |
|
45 | summary: 1 | |
46 |
|
46 | |||
47 | abort: there is nothing to merge - use "hg update" instead |
|
47 | abort: there is nothing to merge - use "hg update" instead | |
48 | failed |
|
48 | failed | |
49 | changeset: 0:33aaa84a386b |
|
49 | changeset: 0:33aaa84a386b | |
50 | user: test |
|
50 | user: test | |
51 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
51 | date: Mon Jan 12 13:46:40 1970 +0000 | |
52 | summary: 1 |
|
52 | summary: 1 | |
53 |
|
53 | |||
54 | resolving manifests |
|
54 | resolving manifests | |
55 | overwrite False partial False |
|
55 | overwrite False partial False | |
56 | ancestor 33aaa84a386b local 33aaa84a386b+ remote 802f095af299 |
|
56 | ancestor 33aaa84a386b local 33aaa84a386b+ remote 802f095af299 | |
57 |
searching for copies back to rev |
|
57 | searching for copies back to rev 1 | |
58 | unmatched files in other: |
|
58 | unmatched files in other: | |
59 | b |
|
59 | b | |
60 | a: versions differ -> m |
|
60 | a: versions differ -> m | |
61 | b: remote created -> g |
|
61 | b: remote created -> g | |
62 | picked tool 'true' for a (binary False symlink False) |
|
62 | picked tool 'true' for a (binary False symlink False) | |
63 | merging a |
|
63 | merging a | |
64 | my a@33aaa84a386b+ other a@802f095af299 ancestor a@33aaa84a386b |
|
64 | my a@33aaa84a386b+ other a@802f095af299 ancestor a@33aaa84a386b | |
65 | getting b |
|
65 | getting b | |
66 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
66 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
67 | changeset: 1:802f095af299 |
|
67 | changeset: 1:802f095af299 | |
68 | tag: tip |
|
68 | tag: tip | |
69 | user: test |
|
69 | user: test | |
70 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
70 | date: Mon Jan 12 13:46:40 1970 +0000 | |
71 | summary: 2 |
|
71 | summary: 2 | |
72 |
|
72 | |||
73 | changeset: 1:802f095af299 |
|
73 | changeset: 1:802f095af299 | |
74 | tag: tip |
|
74 | tag: tip | |
75 | user: test |
|
75 | user: test | |
76 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
76 | date: Mon Jan 12 13:46:40 1970 +0000 | |
77 | files: a b |
|
77 | files: a b | |
78 | description: |
|
78 | description: | |
79 | 2 |
|
79 | 2 | |
80 |
|
80 | |||
81 |
|
81 | |||
82 | changeset: 0:33aaa84a386b |
|
82 | changeset: 0:33aaa84a386b | |
83 | user: test |
|
83 | user: test | |
84 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
84 | date: Mon Jan 12 13:46:40 1970 +0000 | |
85 | files: a |
|
85 | files: a | |
86 | description: |
|
86 | description: | |
87 | 1 |
|
87 | 1 | |
88 |
|
88 | |||
89 |
|
89 | |||
90 | diff -r 802f095af299 a |
|
90 | diff -r 802f095af299 a | |
91 | --- a/a |
|
91 | --- a/a | |
92 | +++ b/a |
|
92 | +++ b/a | |
93 | @@ -1,1 +1,1 @@ |
|
93 | @@ -1,1 +1,1 @@ | |
94 | -a2 |
|
94 | -a2 | |
95 | +abc |
|
95 | +abc | |
96 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
96 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
97 | adding b |
|
97 | adding b | |
98 | M a |
|
98 | M a | |
99 | changeset: 1:802f095af299 |
|
99 | changeset: 1:802f095af299 | |
100 | user: test |
|
100 | user: test | |
101 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
101 | date: Mon Jan 12 13:46:40 1970 +0000 | |
102 | summary: 2 |
|
102 | summary: 2 | |
103 |
|
103 | |||
104 | abort: update spans branches, use 'hg merge' or 'hg update -C' to lose changes |
|
104 | abort: update spans branches, use 'hg merge' or 'hg update -C' to lose changes | |
105 | failed |
|
105 | failed | |
106 | abort: outstanding uncommitted changes |
|
106 | abort: outstanding uncommitted changes | |
107 | failed |
|
107 | failed | |
108 | resolving manifests |
|
108 | resolving manifests | |
109 | overwrite False partial False |
|
109 | overwrite False partial False | |
110 | ancestor 33aaa84a386b local 802f095af299+ remote 030602aee63d |
|
110 | ancestor 33aaa84a386b local 802f095af299+ remote 030602aee63d | |
111 | searching for copies back to rev 1 |
|
111 | searching for copies back to rev 1 | |
112 | a: versions differ -> m |
|
112 | a: versions differ -> m | |
113 | b: versions differ -> m |
|
113 | b: versions differ -> m | |
114 | picked tool 'true' for a (binary False symlink False) |
|
114 | picked tool 'true' for a (binary False symlink False) | |
115 | merging a |
|
115 | merging a | |
116 | my a@802f095af299+ other a@030602aee63d ancestor a@33aaa84a386b |
|
116 | my a@802f095af299+ other a@030602aee63d ancestor a@33aaa84a386b | |
117 | picked tool 'true' for b (binary False symlink False) |
|
117 | picked tool 'true' for b (binary False symlink False) | |
118 | merging b |
|
118 | merging b | |
119 | my b@802f095af299+ other b@030602aee63d ancestor b@000000000000 |
|
119 | my b@802f095af299+ other b@030602aee63d ancestor b@000000000000 | |
120 | 0 files updated, 2 files merged, 0 files removed, 0 files unresolved |
|
120 | 0 files updated, 2 files merged, 0 files removed, 0 files unresolved | |
121 | (branch merge, don't forget to commit) |
|
121 | (branch merge, don't forget to commit) | |
122 | changeset: 1:802f095af299 |
|
122 | changeset: 1:802f095af299 | |
123 | user: test |
|
123 | user: test | |
124 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
124 | date: Mon Jan 12 13:46:40 1970 +0000 | |
125 | summary: 2 |
|
125 | summary: 2 | |
126 |
|
126 | |||
127 | changeset: 2:030602aee63d |
|
127 | changeset: 2:030602aee63d | |
128 | tag: tip |
|
128 | tag: tip | |
129 | parent: 0:33aaa84a386b |
|
129 | parent: 0:33aaa84a386b | |
130 | user: test |
|
130 | user: test | |
131 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
131 | date: Mon Jan 12 13:46:40 1970 +0000 | |
132 | summary: 3 |
|
132 | summary: 3 | |
133 |
|
133 | |||
134 | diff -r 802f095af299 a |
|
134 | diff -r 802f095af299 a | |
135 | --- a/a |
|
135 | --- a/a | |
136 | +++ b/a |
|
136 | +++ b/a | |
137 | @@ -1,1 +1,1 @@ |
|
137 | @@ -1,1 +1,1 @@ | |
138 | -a2 |
|
138 | -a2 | |
139 | +abc |
|
139 | +abc | |
140 | adding a |
|
140 | adding a | |
141 | pulling from ../a |
|
141 | pulling from ../a | |
142 | requesting all changes |
|
142 | requesting all changes | |
143 | adding changesets |
|
143 | adding changesets | |
144 | adding manifests |
|
144 | adding manifests | |
145 | adding file changes |
|
145 | adding file changes | |
146 | added 1 changesets with 1 changes to 1 files |
|
146 | added 1 changesets with 1 changes to 1 files | |
147 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
147 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
General Comments 0
You need to be logged in to leave comments.
Login now