##// END OF EJS Templates
graftcopies: remove `skip` and `repo` arguments...
Martin von Zweigbergk -
r44551:833210fb default
parent child Browse files
Show More
@@ -734,8 +734,7 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 newp1ctx = repo[newp1node]
737 wctx.setbase(repo[newp1node])
738 wctx.setbase(newp1ctx)
739 merge.update(
738 merge.update(
740 repo,
739 repo,
741 ctx.rev(),
740 ctx.rev(),
@@ -745,7 +744,7 b' def replacerev(ui, repo, ctx, filedata, '
745 mergeancestor=False,
744 mergeancestor=False,
746 wc=wctx,
745 wc=wctx,
747 )
746 )
748 copies.graftcopies(repo, wctx, ctx, ctx.p1(), skip=newp1ctx)
747 copies.graftcopies(wctx, ctx, ctx.p1())
749
748
750 for path in filedata.keys():
749 for path in filedata.keys():
751 fctx = ctx[path]
750 fctx = ctx[path]
@@ -1497,16 +1497,13 b' def rebasenode(repo, rev, p1, base, coll'
1497 labels=[b'dest', b'source'],
1497 labels=[b'dest', b'source'],
1498 wc=wctx,
1498 wc=wctx,
1499 )
1499 )
1500 destctx = repo[dest]
1501 if collapse:
1500 if collapse:
1502 copies.graftcopies(repo, wctx, ctx, destctx)
1501 copies.graftcopies(wctx, ctx, repo[dest])
1503 else:
1502 else:
1504 # If we're not using --collapse, we need to
1503 # If we're not using --collapse, we need to
1505 # duplicate copies between the revision we're
1504 # duplicate copies between the revision we're
1506 # rebasing and its first parent, but *not*
1505 # rebasing and its first parent.
1507 # duplicate any copies that have already been
1506 copies.graftcopies(wctx, ctx, ctx.p1())
1508 # performed in the destination.
1509 copies.graftcopies(repo, wctx, ctx, ctx.p1(), skip=destctx)
1510 return stats
1507 return stats
1511
1508
1512
1509
@@ -856,30 +856,11 b' def _related(f1, f2):'
856 return False
856 return False
857
857
858
858
859 def graftcopies(repo, wctx, ctx, base, skip=None):
859 def graftcopies(wctx, ctx, base):
860 """reproduce copies between base and ctx in the wctx
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)
878 new_copies = pathcopies(base, ctx)
861 new_copies = pathcopies(base, ctx)
879 _filter(wctx.p1(), wctx, new_copies)
862 _filter(wctx.p1(), wctx, new_copies)
880 for dst, src in pycompat.iteritems(new_copies):
863 for dst, src in pycompat.iteritems(new_copies):
881 if dst in exclude:
882 continue
883 wctx[dst].markcopied(src)
864 wctx[dst].markcopied(src)
884
865
885
866
@@ -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.graftcopies(repo, wctx, ctx, base)
2638 copies.graftcopies(wctx, ctx, base)
2639 return stats
2639 return stats
2640
2640
2641
2641
@@ -31,4 +31,5 b''
31
31
32 * `copies.duplicatecopies()` was renamed to
32 * `copies.duplicatecopies()` was renamed to
33 `copies.graftcopies()`. Its arguments changed from revision numbers
33 `copies.graftcopies()`. Its arguments changed from revision numbers
34 to context objects.
34 to context objects. It also lost its `repo` and `skip` arguments
35 (they should no longer be needed).
General Comments 0
You need to be logged in to leave comments. Login now