]> khamidou — GitHub mirrors - arcanist.git/commitdiff
After landing to a repository, hint that it should be updated
authorepriestley <git@epriestley.com>
Wed, 16 Apr 2014 20:01:14 +0000 (13:01 -0700)
committerepriestley <git@epriestley.com>
Wed, 16 Apr 2014 20:01:14 +0000 (13:01 -0700)
Summary: Fixes T4605. Smart waits (see D8782) are presumably good on the balance, but may cause some delays when changes are made to rarely updated repositories. To help mitigate this, have `arc land` hint that a repository has changed.

Test Plan: Will run `arc land`.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4605

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

src/workflow/ArcanistLandWorkflow.php

index a21b56116fb2f7e0aa87b9a0f6f92b2bb3a6c023..17c3f4ad137491c9296c196be552a5d0d5b2d8e8 100644 (file)
@@ -998,6 +998,24 @@ EOTEXT
           $cmd));
       }
 
+      // If we know which repository we're in, try to tell Phabricator that we
+      // pushed commits to it so it can update. This hint can help pull updates
+      // more quickly, especially in rarely-used repositories.
+      if ($this->getRepositoryCallsign()) {
+        try {
+          $this->getConduit()->callMethodSynchronous(
+            'diffusion.looksoon',
+            array(
+              'callsign' => $this->getRepositoryCallsign(),
+            ));
+        } catch (ConduitClientException $ex) {
+          // If we hit an exception, just ignore it. Likely, we are running
+          // against a Phabricator which is too old to support this method.
+          // Since this hint is purely advisory, it doesn't matter if it has
+          // no effect.
+        }
+      }
+
       $mark_workflow = $this->buildChildWorkflow(
         'close-revision',
         array(