@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Don't pull updates for repositories marked as hosted

Summary:
- Don't try to pull hosted repos.
- Also, fix the `--verbose` + `--trace` interaction for `bin/repository`.
- Also, fix a couple of unit tests which got tweaked earlier.

Test Plan:
$ ./bin/repository pull GTEST --verbose
Pulling 'GTEST'...
Repository "GTEST" is hosted, so Phabricator does not pull updates for it.
Done.

Reviewers: btrahan, hach-que

Reviewed By: hach-que

CC: aran

Maniphest Tasks: T2230

Differential Revision: https://secure.phabricator.com/D7427

+16 -3
+2 -1
src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php
··· 128 128 129 129 if (!$no_discovery) { 130 130 // TODO: It would be nice to discover only if we pulled something, 131 - // but this isn't totally trivial. 131 + // but this isn't totally trivial. It's slightly more complicated 132 + // with hosted repositories, too. 132 133 133 134 $lock_name = get_class($this).':'.$callsign; 134 135 $lock = PhabricatorGlobalLock::newLock($lock_name);
+2 -1
src/applications/repository/engine/PhabricatorRepositoryEngine.php
··· 54 54 if ($this->getVerbose()) { 55 55 $console = PhutilConsole::getConsole(); 56 56 $argv = func_get_args(); 57 - call_user_func_array(array($console, 'writeLog'), $argv); 57 + $argv[0] = $argv[0]."\n"; 58 + call_user_func_array(array($console, 'writeOut'), $argv); 58 59 } 59 60 return $this; 60 61 }
+10
src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
··· 25 25 26 26 $vcs = $repository->getVersionControlSystem(); 27 27 $callsign = $repository->getCallsign(); 28 + 29 + if ($repository->isHosted()) { 30 + $this->log( 31 + pht( 32 + 'Repository "%s" is hosted, so Phabricator does not pull updates '. 33 + 'for it.', 34 + $callsign)); 35 + return; 36 + } 37 + 28 38 switch ($vcs) { 29 39 case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: 30 40 // We never pull a local copy of Subversion repositories.
+2 -1
src/applications/repository/engine/__tests__/PhabricatorWorkingCopyTestCase.php
··· 45 45 $dir = PhutilDirectoryFixture::newFromArchive($path); 46 46 $local = new TempFile('.ignore'); 47 47 48 - $repo = id(new PhabricatorRepository()) 48 + $user = $this->generateNewTestUser(); 49 + $repo = PhabricatorRepository::initializeNewRepository($user) 49 50 ->setCallsign($callsign) 50 51 ->setName(pht('Test Repo "%s"', $callsign)) 51 52 ->setVersionControlSystem($vcs_type)