comparison mercurial/copies.py @ 44092:833210fbd900

graftcopies: remove `skip` and `repo` arguments The `skip` argument was added in 2ba6c9b4e0eb (rebase: fix bug that caused transitive copy records to disappear (issue4192), 2014-06-07) in order to fix https://bz.mercurial-scm.org/show_bug.cgi?id=4192. I ran tests at that commit without the `skiprev` argument and the only difference I noticed was that `test-rebase-collapse.t` failed differently, in the call that is now on line 501. Without the `skiprev` argument, that call would end up creating another commit because it tried to record an invalid copy. With the previous patch in this series, such invalid copies are no longer recorded, so it seems we don't need the `skip` argument anymore. I also removed the `repo` argument since that also becomes unused with the removal of the `skip` argument. Differential Revision: https://phab.mercurial-scm.org/D7860
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 27 Dec 2019 13:47:59 -0800
parents 3df0bd706c40
children 06e7e7652ac0
comparison
equal deleted inserted replaced
44091:3df0bd706c40 44092:833210fbd900
854 return f1 == f2 # true if they point to the same file 854 return f1 == f2 # true if they point to the same file
855 except StopIteration: 855 except StopIteration:
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
886 def computechangesetfilesadded(ctx): 867 def computechangesetfilesadded(ctx):
887 """return the list of files added in a changeset 868 """return the list of files added in a changeset