Page MenuHomePhorge

How to set the Pull Time Limit for Mercurial repos?
Closed, ResolvedPublic

Asked by tinloaf on Apr 26 2023, 08:24.


I have a large Mercurial repository that I want to 'observe'. The repository is too large to be pulled within the default time limit of 15 minutes, therefore the pull times out.

I see that in , the possibility was added to configure a pull time limit for repositories. However, when I open the management view for that repo, I don't see the 'Limits' panel in the nav bar on the left.

The code responsible for setting this limit (by calling $repository->setCopyTimeLimit()) seems to be in , which contains this function:

public function shouldEnableForRepository(
  PhabricatorRepository $repository) {
  return $repository->isGit();

This probably explains why I don't see this panel for my Mercurial repo. However, setCopyTimeLimit() and get(Effective)CopyTimeLimit() methods are part of the base class for repositories and would also be available for a mercurial repository. In fact, reading through the code, the future that runs the pull is created in the base class, i.e., in the exact same way for Mercurial and git repositories.

Two questions:

1.) Is this function intentionally disabled for Mercurial repos? If not, I could cook up a patch (even though I'm really not a PHP developer) - the question is then whether this should be enabled for *all* repos or whether we just want to add Mercurial repos (which would then only exclude SVN, right?)

2.) The getCopyTimeLimit() function uses $repo->getDetail('limit.copy'); to retrieve a time limit, if one was set. Is it possible as a workaround to manually set that 'detail' on a repository? Would I have to manually modify the database, or does a tool exist that allows this modification?


Updated 419 Days Ago

  1. Looks like it was made git-only because it was only supposed to be used in the context of Drydock, which is git-only. I think having it effect the actual initial clone is a bug (See Comments).

In the spirit of T8227, the cleaner solution would be to fix the bug, leave the config git-only, and add some text explaining why it's git-only.

  1. You can edit the detail in the database by directly editing the DB entry. It should be just a JSON blob in the phabricator_repository.repository table.

Bonus: You can also just manually do the clone by running the right hg pull command as the right user.

New Answer


This question has been marked as closed, but you can still leave a new answer.