Show More
@@ -334,11 +334,13 b' def _checkcollision(repo, wmf, actions):' | |||||
334 | def nop(f, args): |
|
334 | def nop(f, args): | |
335 | pass |
|
335 | pass | |
336 |
|
336 | |||
337 | def renameop(f, args): |
|
337 | def renamemoveop(f, args): | |
338 |
f2 |
|
338 | f2, flags = args | |
339 | if f: |
|
339 | pmmf.discard(f2) | |
340 |
|
|
340 | pmmf.add(f) | |
341 | pmmf.add(fd) |
|
341 | def renamegetop(f, args): | |
|
342 | f2, flags = args | |||
|
343 | pmmf.add(f) | |||
342 | def mergeop(f, args): |
|
344 | def mergeop(f, args): | |
343 | f2, fa, fd, move, anc = args |
|
345 | f2, fa, fd, move, anc = args | |
344 | if move: |
|
346 | if move: | |
@@ -347,7 +349,8 b' def _checkcollision(repo, wmf, actions):' | |||||
347 |
|
349 | |||
348 | opmap = { |
|
350 | opmap = { | |
349 | "a": addop, |
|
351 | "a": addop, | |
350 | "d": renameop, |
|
352 | "dm": renamemoveop, | |
|
353 | "dg": renamegetop, | |||
351 | "dr": nop, |
|
354 | "dr": nop, | |
352 | "e": nop, |
|
355 | "e": nop, | |
353 | "f": addop, # untracked file should be kept in working directory |
|
356 | "f": addop, # untracked file should be kept in working directory | |
@@ -472,10 +475,10 b' def manifestmerge(repo, wctx, p2, pa, br' | |||||
472 | "versions differ")) |
|
475 | "versions differ")) | |
473 | elif f in copied: # files we'll deal with on m2 side |
|
476 | elif f in copied: # files we'll deal with on m2 side | |
474 | pass |
|
477 | pass | |
475 | elif n1 and f in movewithdir: # directory rename |
|
478 | elif n1 and f in movewithdir: # directory rename, move local | |
476 | f2 = movewithdir[f] |
|
479 | f2 = movewithdir[f] | |
477 |
actions.append((f, "d", ( |
|
480 | actions.append((f2, "dm", (f, fl1), | |
478 |
"remote |
|
481 | "remote directory rename - move from " + f)) | |
479 | elif n1 and f in copy: |
|
482 | elif n1 and f in copy: | |
480 | f2 = copy[f] |
|
483 | f2 = copy[f] | |
481 | actions.append((f, "m", (f2, f2, f, False, pa.node()), |
|
484 | actions.append((f, "m", (f2, f2, f, False, pa.node()), | |
@@ -492,8 +495,8 b' def manifestmerge(repo, wctx, p2, pa, br' | |||||
492 | actions.append((f, "r", None, "other deleted")) |
|
495 | actions.append((f, "r", None, "other deleted")) | |
493 | elif n2 and f in movewithdir: |
|
496 | elif n2 and f in movewithdir: | |
494 | f2 = movewithdir[f] |
|
497 | f2 = movewithdir[f] | |
495 |
actions.append(( |
|
498 | actions.append((f2, "dg", (f, fl2), | |
496 |
"local |
|
499 | "local directory rename - get from " + f)) | |
497 | elif n2 and f in copy: |
|
500 | elif n2 and f in copy: | |
498 | f2 = copy[f] |
|
501 | f2 = copy[f] | |
499 | if f2 in m2: |
|
502 | if f2 in m2: | |
@@ -693,16 +696,17 b' def applyupdates(repo, actions, wctx, mc' | |||||
693 | updated += 1 |
|
696 | updated += 1 | |
694 | else: |
|
697 | else: | |
695 | merged += 1 |
|
698 | merged += 1 | |
696 | elif m == "d": # directory rename |
|
699 | elif m == "dm": # directory rename, move local | |
697 |
f |
|
700 | f0, flags = args | |
698 | if f: |
|
701 | repo.ui.note(_("moving %s to %s\n") % (f0, f)) | |
699 | repo.ui.note(_("moving %s to %s\n") % (f, fd)) |
|
702 | audit(f) | |
700 | audit(fd) |
|
703 | repo.wwrite(f, wctx.filectx(f0).data(), flags) | |
701 | repo.wwrite(fd, wctx.filectx(f).data(), flags) |
|
704 | util.unlinkpath(repo.wjoin(f0)) | |
702 | util.unlinkpath(repo.wjoin(f)) |
|
705 | updated += 1 | |
703 | if f2: |
|
706 | elif m == "dg": # local directory rename, get | |
704 | repo.ui.note(_("getting %s to %s\n") % (f2, fd)) |
|
707 | f0, flags = args | |
705 | repo.wwrite(fd, mctx.filectx(f2).data(), flags) |
|
708 | repo.ui.note(_("getting %s to %s\n") % (f0, f)) | |
|
709 | repo.wwrite(f, mctx.filectx(f0).data(), flags) | |||
706 | updated += 1 |
|
710 | updated += 1 | |
707 | elif m == "dr": # divergent renames |
|
711 | elif m == "dr": # divergent renames | |
708 | fl, = args |
|
712 | fl, = args | |
@@ -811,22 +815,25 b' def recordupdates(repo, actions, branchm' | |||||
811 | repo.dirstate.normallookup(fd) |
|
815 | repo.dirstate.normallookup(fd) | |
812 | if move: |
|
816 | if move: | |
813 | repo.dirstate.drop(f) |
|
817 | repo.dirstate.drop(f) | |
814 | elif m == "d": # directory rename |
|
818 | elif m == "dm": # directory rename, move local | |
815 |
f |
|
819 | f0, flag = args | |
816 |
if |
|
820 | if f0 not in repo.dirstate: | |
817 | # untracked file moved |
|
821 | # untracked file moved | |
818 | continue |
|
822 | continue | |
819 | if branchmerge: |
|
823 | if branchmerge: | |
820 |
repo.dirstate.add(f |
|
824 | repo.dirstate.add(f) | |
821 | if f: |
|
825 | repo.dirstate.remove(f0) | |
822 |
|
|
826 | repo.dirstate.copy(f0, f) | |
823 | repo.dirstate.copy(f, fd) |
|
|||
824 | if f2: |
|
|||
825 | repo.dirstate.copy(f2, fd) |
|
|||
826 | else: |
|
827 | else: | |
827 |
repo.dirstate.normal(f |
|
828 | repo.dirstate.normal(f) | |
828 |
|
|
829 | repo.dirstate.drop(f0) | |
829 | repo.dirstate.drop(f) |
|
830 | elif m == "dg": # directory rename, get | |
|
831 | f0, flag = args | |||
|
832 | if branchmerge: | |||
|
833 | repo.dirstate.add(f) | |||
|
834 | repo.dirstate.copy(f0, f) | |||
|
835 | else: | |||
|
836 | repo.dirstate.normal(f) | |||
830 |
|
837 | |||
831 | def update(repo, node, branchmerge, force, partial, ancestor=None, |
|
838 | def update(repo, node, branchmerge, force, partial, ancestor=None, | |
832 | mergeancestor=False): |
|
839 | mergeancestor=False): |
@@ -41,16 +41,16 b'' | |||||
41 | ancestor: f9b20c0d4c51, local: ce36d17b18fb+, remote: 397f8b00a740 |
|
41 | ancestor: f9b20c0d4c51, local: ce36d17b18fb+, remote: 397f8b00a740 | |
42 | a/a: other deleted -> r |
|
42 | a/a: other deleted -> r | |
43 | a/b: other deleted -> r |
|
43 | a/b: other deleted -> r | |
44 | a/c: remote renamed directory to b/c -> d |
|
|||
45 | b/a: remote created -> g |
|
44 | b/a: remote created -> g | |
46 | b/b: remote created -> g |
|
45 | b/b: remote created -> g | |
|
46 | b/c: remote directory rename - move from a/c -> dm | |||
47 | removing a/a |
|
47 | removing a/a | |
48 | removing a/b |
|
48 | removing a/b | |
49 | updating: a/b 2/5 files (40.00%) |
|
49 | updating: a/b 2/5 files (40.00%) | |
50 | getting b/a |
|
50 | getting b/a | |
51 | getting b/b |
|
51 | getting b/b | |
52 | updating: b/b 4/5 files (80.00%) |
|
52 | updating: b/b 4/5 files (80.00%) | |
53 |
updating: |
|
53 | updating: b/c 5/5 files (100.00%) | |
54 | moving a/c to b/c (glob) |
|
54 | moving a/c to b/c (glob) | |
55 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
55 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
56 | (branch merge, don't forget to commit) |
|
56 | (branch merge, don't forget to commit) | |
@@ -88,8 +88,8 b'' | |||||
88 | resolving manifests |
|
88 | resolving manifests | |
89 | branchmerge: True, force: False, partial: False |
|
89 | branchmerge: True, force: False, partial: False | |
90 | ancestor: f9b20c0d4c51, local: 397f8b00a740+, remote: ce36d17b18fb |
|
90 | ancestor: f9b20c0d4c51, local: 397f8b00a740+, remote: ce36d17b18fb | |
91 |
|
|
91 | b/c: local directory rename - get from a/c -> dg | |
92 |
updating: |
|
92 | updating: b/c 1/1 files (100.00%) | |
93 | getting a/c to b/c |
|
93 | getting a/c to b/c | |
94 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
94 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
95 | (branch merge, don't forget to commit) |
|
95 | (branch merge, don't forget to commit) |
General Comments 0
You need to be logged in to leave comments.
Login now