Show More
@@ -734,7 +734,8 b' def replacerev(ui, repo, ctx, filedata, ' | |||||
734 | extra[b'fix_source'] = ctx.hex() |
|
734 | extra[b'fix_source'] = ctx.hex() | |
735 |
|
735 | |||
736 | wctx = context.overlayworkingctx(repo) |
|
736 | wctx = context.overlayworkingctx(repo) | |
737 |
|
|
737 | newp1ctx = repo[newp1node] | |
|
738 | wctx.setbase(newp1ctx) | |||
738 | merge.update( |
|
739 | merge.update( | |
739 | repo, |
|
740 | repo, | |
740 | ctx.rev(), |
|
741 | ctx.rev(), | |
@@ -744,9 +745,7 b' def replacerev(ui, repo, ctx, filedata, ' | |||||
744 | mergeancestor=False, |
|
745 | mergeancestor=False, | |
745 | wc=wctx, |
|
746 | wc=wctx, | |
746 | ) |
|
747 | ) | |
747 | copies.duplicatecopies( |
|
748 | copies.graftcopies(repo, wctx, ctx, ctx.p1(), skip=newp1ctx) | |
748 | repo, wctx, ctx.rev(), ctx.p1().rev(), skiprev=newp1node |
|
|||
749 | ) |
|
|||
750 |
|
749 | |||
751 | for path in filedata.keys(): |
|
750 | for path in filedata.keys(): | |
752 | fctx = ctx[path] |
|
751 | fctx = ctx[path] |
@@ -1481,7 +1481,8 b' def rebasenode(repo, rev, p1, base, coll' | |||||
1481 | # as well as other data we litter on it in other places. |
|
1481 | # as well as other data we litter on it in other places. | |
1482 | wctx = repo[None] |
|
1482 | wctx = repo[None] | |
1483 | repo.dirstate.write(repo.currenttransaction()) |
|
1483 | repo.dirstate.write(repo.currenttransaction()) | |
1484 | repo.ui.debug(b" merge against %d:%s\n" % (rev, repo[rev])) |
|
1484 | ctx = repo[rev] | |
|
1485 | repo.ui.debug(b" merge against %d:%s\n" % (rev, ctx)) | |||
1485 | if base is not None: |
|
1486 | if base is not None: | |
1486 | repo.ui.debug(b" detach base %d:%s\n" % (base, repo[base])) |
|
1487 | repo.ui.debug(b" detach base %d:%s\n" % (base, repo[base])) | |
1487 | # When collapsing in-place, the parent is the common ancestor, we |
|
1488 | # When collapsing in-place, the parent is the common ancestor, we | |
@@ -1496,16 +1497,16 b' def rebasenode(repo, rev, p1, base, coll' | |||||
1496 | labels=[b'dest', b'source'], |
|
1497 | labels=[b'dest', b'source'], | |
1497 | wc=wctx, |
|
1498 | wc=wctx, | |
1498 | ) |
|
1499 | ) | |
|
1500 | destctx = repo[dest] | |||
1499 | if collapse: |
|
1501 | if collapse: | |
1500 |
copies. |
|
1502 | copies.graftcopies(repo, wctx, ctx, destctx) | |
1501 | else: |
|
1503 | else: | |
1502 | # If we're not using --collapse, we need to |
|
1504 | # If we're not using --collapse, we need to | |
1503 | # duplicate copies between the revision we're |
|
1505 | # duplicate copies between the revision we're | |
1504 | # rebasing and its first parent, but *not* |
|
1506 | # rebasing and its first parent, but *not* | |
1505 | # duplicate any copies that have already been |
|
1507 | # duplicate any copies that have already been | |
1506 | # performed in the destination. |
|
1508 | # performed in the destination. | |
1507 | p1rev = repo[rev].p1().rev() |
|
1509 | copies.graftcopies(repo, wctx, ctx, ctx.p1(), skip=destctx) | |
1508 | copies.duplicatecopies(repo, wctx, rev, p1rev, skiprev=dest) |
|
|||
1509 | return stats |
|
1510 | return stats | |
1510 |
|
1511 | |||
1511 |
|
1512 |
@@ -856,26 +856,26 b' def _related(f1, f2):' | |||||
856 | return False |
|
856 | return False | |
857 |
|
857 | |||
858 |
|
858 | |||
859 |
def |
|
859 | def graftcopies(repo, wctx, ctx, base, skip=None): | |
860 |
"""reproduce copies |
|
860 | """reproduce copies between base and ctx in the wctx | |
861 |
|
861 | |||
862 |
If skip |
|
862 | If skip is specified, it's a revision that should be used to | |
863 |
filter copy records. Any copies that occur between |
|
863 | filter copy records. Any copies that occur between base and | |
864 |
skip |
|
864 | skip will not be duplicated, even if they appear in the set of | |
865 |
copies between |
|
865 | copies between base and ctx. | |
866 | """ |
|
866 | """ | |
867 | exclude = {} |
|
867 | exclude = {} | |
868 | ctraceconfig = repo.ui.config(b'experimental', b'copytrace') |
|
868 | ctraceconfig = repo.ui.config(b'experimental', b'copytrace') | |
869 | bctrace = stringutil.parsebool(ctraceconfig) |
|
869 | bctrace = stringutil.parsebool(ctraceconfig) | |
870 |
if skip |
|
870 | if skip is not None and ( | |
871 | ctraceconfig == b'heuristics' or bctrace or bctrace is None |
|
871 | ctraceconfig == b'heuristics' or bctrace or bctrace is None | |
872 | ): |
|
872 | ): | |
873 | # copytrace='off' skips this line, but not the entire function because |
|
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 |
|
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 |
|
875 | # of the function is much faster (and is required for carrying copy | |
876 | # metadata across the rebase anyway). |
|
876 | # metadata across the rebase anyway). | |
877 |
exclude = pathcopies( |
|
877 | exclude = pathcopies(base, skip) | |
878 |
for dst, src in pycompat.iteritems(pathcopies( |
|
878 | for dst, src in pycompat.iteritems(pathcopies(base, ctx)): | |
879 | if dst in exclude: |
|
879 | if dst in exclude: | |
880 | continue |
|
880 | continue | |
881 | if dst in wctx: |
|
881 | if dst in wctx: |
@@ -2635,7 +2635,7 b' def graft(' | |||||
2635 | repo.setparents(pctx.node(), pother) |
|
2635 | repo.setparents(pctx.node(), pother) | |
2636 | repo.dirstate.write(repo.currenttransaction()) |
|
2636 | repo.dirstate.write(repo.currenttransaction()) | |
2637 | # fix up dirstate for copies and renames |
|
2637 | # fix up dirstate for copies and renames | |
2638 |
copies. |
|
2638 | copies.graftcopies(repo, wctx, ctx, base) | |
2639 | return stats |
|
2639 | return stats | |
2640 |
|
2640 | |||
2641 |
|
2641 |
@@ -28,3 +28,7 b'' | |||||
28 | * `n in revlog.nodemap` becomes `revlog.index.has_node(n)`, |
|
28 | * `n in revlog.nodemap` becomes `revlog.index.has_node(n)`, | |
29 | * `revlog.nodemap[n]` becomes `revlog.index.rev(n)`, |
|
29 | * `revlog.nodemap[n]` becomes `revlog.index.rev(n)`, | |
30 | * `revlog.nodemap.get(n)` becomes `revlog.index.get_rev(n)`. |
|
30 | * `revlog.nodemap.get(n)` becomes `revlog.index.get_rev(n)`. | |
|
31 | ||||
|
32 | * `copies.duplicatecopies()` was renamed to | |||
|
33 | `copies.graftcopies()`. Its arguments changed from revision numbers | |||
|
34 | to context objects. |
General Comments 0
You need to be logged in to leave comments.
Login now