Show More
@@ -734,8 +734,7 b' def replacerev(ui, repo, ctx, filedata, ' | |||
|
734 | 734 | extra[b'fix_source'] = ctx.hex() |
|
735 | 735 | |
|
736 | 736 | wctx = context.overlayworkingctx(repo) |
|
737 |
|
|
|
738 | wctx.setbase(newp1ctx) | |
|
737 | wctx.setbase(repo[newp1node]) | |
|
739 | 738 | merge.update( |
|
740 | 739 | repo, |
|
741 | 740 | ctx.rev(), |
@@ -745,7 +744,7 b' def replacerev(ui, repo, ctx, filedata, ' | |||
|
745 | 744 | mergeancestor=False, |
|
746 | 745 | wc=wctx, |
|
747 | 746 | ) |
|
748 |
copies.graftcopies( |
|
|
747 | copies.graftcopies(wctx, ctx, ctx.p1()) | |
|
749 | 748 | |
|
750 | 749 | for path in filedata.keys(): |
|
751 | 750 | fctx = ctx[path] |
@@ -1497,16 +1497,13 b' def rebasenode(repo, rev, p1, base, coll' | |||
|
1497 | 1497 | labels=[b'dest', b'source'], |
|
1498 | 1498 | wc=wctx, |
|
1499 | 1499 | ) |
|
1500 | destctx = repo[dest] | |
|
1501 | 1500 | if collapse: |
|
1502 |
copies.graftcopies( |
|
|
1501 | copies.graftcopies(wctx, ctx, repo[dest]) | |
|
1503 | 1502 | else: |
|
1504 | 1503 | # If we're not using --collapse, we need to |
|
1505 | 1504 | # duplicate copies between the revision we're |
|
1506 |
# rebasing and its first parent |
|
|
1507 | # duplicate any copies that have already been | |
|
1508 | # performed in the destination. | |
|
1509 | copies.graftcopies(repo, wctx, ctx, ctx.p1(), skip=destctx) | |
|
1505 | # rebasing and its first parent. | |
|
1506 | copies.graftcopies(wctx, ctx, ctx.p1()) | |
|
1510 | 1507 | return stats |
|
1511 | 1508 | |
|
1512 | 1509 |
@@ -856,30 +856,11 b' def _related(f1, f2):' | |||
|
856 | 856 | return False |
|
857 | 857 | |
|
858 | 858 | |
|
859 |
def graftcopies( |
|
|
860 | """reproduce copies between base and ctx in the wctx | |
|
861 | ||
|
862 | If skip is specified, it's a revision that should be used to | |
|
863 | filter copy records. Any copies that occur between base and | |
|
864 | skip will not be duplicated, even if they appear in the set of | |
|
865 | copies between base and ctx. | |
|
866 | """ | |
|
867 | exclude = {} | |
|
868 | ctraceconfig = repo.ui.config(b'experimental', b'copytrace') | |
|
869 | bctrace = stringutil.parsebool(ctraceconfig) | |
|
870 | if skip is not None and ( | |
|
871 | ctraceconfig == b'heuristics' or bctrace or bctrace is None | |
|
872 | ): | |
|
873 | # copytrace='off' skips this line, but not the entire function because | |
|
874 | # the line below is O(size of the repo) during a rebase, while the rest | |
|
875 | # of the function is much faster (and is required for carrying copy | |
|
876 | # metadata across the rebase anyway). | |
|
877 | exclude = pathcopies(base, skip) | |
|
859 | def graftcopies(wctx, ctx, base): | |
|
860 | """reproduce copies between base and ctx in the wctx""" | |
|
878 | 861 | new_copies = pathcopies(base, ctx) |
|
879 | 862 | _filter(wctx.p1(), wctx, new_copies) |
|
880 | 863 | for dst, src in pycompat.iteritems(new_copies): |
|
881 | if dst in exclude: | |
|
882 | continue | |
|
883 | 864 | wctx[dst].markcopied(src) |
|
884 | 865 | |
|
885 | 866 |
@@ -2635,7 +2635,7 b' def graft(' | |||
|
2635 | 2635 | repo.setparents(pctx.node(), pother) |
|
2636 | 2636 | repo.dirstate.write(repo.currenttransaction()) |
|
2637 | 2637 | # fix up dirstate for copies and renames |
|
2638 |
copies.graftcopies( |
|
|
2638 | copies.graftcopies(wctx, ctx, base) | |
|
2639 | 2639 | return stats |
|
2640 | 2640 | |
|
2641 | 2641 |
General Comments 0
You need to be logged in to leave comments.
Login now