Skip to content

Commit

Permalink
ext: drop "repo.local()" check from reposetup
Browse files Browse the repository at this point in the history
Summary:
Now "reposetup" is only called for local repos. Let's just drop the redundant
check in individual extensions.

Reviewed By: muirdm

Differential Revision: D65880609

fbshipit-source-id: 437f6200e62c6213ef2bb7560a341a0bd91ba7fd
  • Loading branch information
quark-zju authored and facebook-github-bot committed Nov 13, 2024
1 parent f73365d commit 076fd17
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 31 deletions.
6 changes: 0 additions & 6 deletions eden/scm/sapling/ext/blackbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,6 @@ def uisetup(ui) -> None:


def reposetup(ui, repo) -> None:
# During 'hg pull' a httppeer repo is created to represent the remote repo.
# It doesn't have a .hg directory to put a blackbox in, so we don't do
# the blackbox setup for it.
if not repo.local():
return

if hasattr(ui, "setrepo"):
ui.setrepo(repo)

Expand Down
2 changes: 1 addition & 1 deletion eden/scm/sapling/ext/dirsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def extsetup(ui) -> None:


def reposetup(ui, repo) -> None:
if not repo.local() or not hasattr(repo, "dirstate"):
if not hasattr(repo, "dirstate"):
return

dirstate, cached = localrepo.isfilecached(repo, "dirstate")
Expand Down
2 changes: 1 addition & 1 deletion eden/scm/sapling/ext/edensparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def uisetup(ui) -> None:


def reposetup(ui, repo) -> None:
if not repo.local() or "edensparse" not in repo.requirements:
if "edensparse" not in repo.requirements:
return

_wraprepo(ui, repo)
Expand Down
4 changes: 0 additions & 4 deletions eden/scm/sapling/ext/fsmonitor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,6 @@ def reposetup(ui, repo):
)
return

# We only work with local repositories
if not repo.local():
return

# For Eden-backed repositories the eden extension already handles optimizing
# dirstate operations. Let the eden extension manage the dirstate in this case.
if "eden" in repo.requirements:
Expand Down
3 changes: 0 additions & 3 deletions eden/scm/sapling/ext/hgevents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ def reposetup(ui, repo):
)
return

if not repo.local():
return

# Ensure there is a Watchman client associated with the repo that
# state_update() can use later.
watchmanclient.createclientforrepo(repo)
Expand Down
2 changes: 1 addition & 1 deletion eden/scm/sapling/ext/infinitepush/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

def reposetup(ui, repo):
common.reposetup(ui, repo)
if common.isserver(ui) and repo.local():
if common.isserver(ui):
repo.bundlestore = bundlestore.bundlestore(repo)


Expand Down
19 changes: 9 additions & 10 deletions eden/scm/sapling/ext/journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,15 @@ def extsetup(ui) -> None:


def reposetup(ui, repo) -> None:
if repo.local():
repo.journal = journalstorage(repo)
repo._wlockfreeprefix.add("namejournal")

dirstate, cached = localrepo.isfilecached(repo, "dirstate")
if cached:
# already instantiated dirstate isn't yet marked as
# "journal"-ing, even though repo.dirstate() was already
# wrapped by own wrapdirstate()
_setupdirstate(repo, dirstate)
repo.journal = journalstorage(repo)
repo._wlockfreeprefix.add("namejournal")

dirstate, cached = localrepo.isfilecached(repo, "dirstate")
if cached:
# already instantiated dirstate isn't yet marked as
# "journal"-ing, even though repo.dirstate() was already
# wrapped by own wrapdirstate()
_setupdirstate(repo, dirstate)


def runcommand(orig, lui, repo, cmd, fullargs, *args):
Expand Down
2 changes: 0 additions & 2 deletions eden/scm/sapling/ext/sigtrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ def uisetup(ui) -> None:

def reposetup(ui, repo) -> None:
# Do not track known long-running commands.
if not repo.local():
return
interval = ui.configint("sigtrace", "interval")
if not interval or interval <= 0:
return
Expand Down
3 changes: 0 additions & 3 deletions eden/scm/sapling/ext/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ def extsetup(ui) -> None:


def reposetup(ui, repo) -> None:
if not repo.local():
return

# The sparse extension should never be enabled in Eden repositories;
# Eden automatically only fetches the parts of the repository that are
# actually required.
Expand Down

0 comments on commit 076fd17

Please sign in to comment.