Skip to content

Commit

Permalink
copies: delete _naivecopies() for eagerepo
Browse files Browse the repository at this point in the history
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
  • Loading branch information
zzl0 authored and facebook-github-bot committed Mar 19, 2024
1 parent 858d76c commit 5326324
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions eden/scm/sapling/copies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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
Expand Down

0 comments on commit 5326324

Please sign in to comment.