From 53263249227e4f257b4f4ddde2e76e2344f3435a Mon Sep 17 00:00:00 2001 From: Zhaolong Zhu Date: Tue, 19 Mar 2024 10:05:19 -0700 Subject: [PATCH] copies: delete _naivecopies() for eagerepo Summary: We probably don't need special logic for eagerepo, which was added for tests. Let's delete `_naivecopies` for eagerepo and see what tests break. Reviewed By: muirdm Differential Revision: D55031909 fbshipit-source-id: 7afe53cd363f297fa6e567e1782f0722439e772e --- eden/scm/sapling/copies.py | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/eden/scm/sapling/copies.py b/eden/scm/sapling/copies.py index b1b65404e90d2..1df0acacdd646 100644 --- a/eden/scm/sapling/copies.py +++ b/eden/scm/sapling/copies.py @@ -199,11 +199,6 @@ def _gitfindcopies(repo, oldnode, newnode): def pathcopies(x, y, match=None): """find {dst@y: src@x} copy mapping for directed compare""" - from . import eagerepo - - if eagerepo.iseagerepo(x.repo()): - return _naivecopies(x, y, match) - # we use git2 Rust library to do the actual work for git repo. if git.isgitformat(x.repo()): return _gitfindcopies(x.repo(), x.node(), y.node()) @@ -218,32 +213,6 @@ def pathcopies(x, y, match=None): return _chain(x, y, _backwardrenames(x, a), _forwardcopies(a, y, match=match)) -# Only handles special case of copies between parent and child, -# optionally w/ wctx as well. -def _naivecopies(x, y, match=None): - wctx = None - if y.rev() is None: - wctx = y - y = y.p1() - - if y.p1() != x or y.p2().node() != node.nullid: - return {} - - copies = {} - for f in y.files(): - if match and not match(f): - continue - if f in y: - rename = y[f].renamed() - if rename: - copies[f] = rename[0] - - if wctx: - copies = _chain(x, wctx, copies, _dirstatecopies(wctx.repo().dirstate, match)) - - return copies - - def _computenonoverlap(repo, c1, c2, addedinm1, addedinm2, baselabel=""): """Computes, based on addedinm1 and addedinm2, the files exclusive to c1 and c2. This is its own function so extensions can easily wrap this call