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 |