Changeset View
Changeset View
Standalone View
Standalone View
src/land/engine/ArcanistLandEngine.php
| Show First 20 Lines • Show All 1,253 Lines • ▼ Show 20 Lines | try { | ||||
| $is_last = ($set_key === $last_key); | $is_last = ($set_key === $last_key); | ||||
| $should_push = $is_last; | $should_push = $is_last; | ||||
| } | } | ||||
| if ($should_push) { | if ($should_push) { | ||||
| try { | try { | ||||
| $this->pushChange($into_commit); | $this->pushChange($into_commit); | ||||
| $this->setHasUnpushedChanges(false); | $this->setHasUnpushedChanges(false); | ||||
| } catch (Exception $ex) { | } catch (ArcanistLandPushFailureException $ex) { | ||||
| // TODO: If the push fails, fetch and retry if the remote ref | // TODO: If the push fails, fetch and retry if the remote ref | ||||
| // has moved ahead of us. | // has moved ahead of us. | ||||
| if ($this->getIntoLocal()) { | if ($this->getIntoLocal()) { | ||||
| $can_retry = false; | $can_retry = false; | ||||
| } else if ($this->getIntoEmpty()) { | } else if ($this->getIntoEmpty()) { | ||||
| $can_retry = false; | $can_retry = false; | ||||
| } else if ($this->getIntoRemote() !== $this->getOntoRemote()) { | } else if ($this->getIntoRemote() !== $this->getOntoRemote()) { | ||||
| $can_retry = false; | $can_retry = false; | ||||
| } else { | } else { | ||||
| $can_retry = false; | $can_retry = false; | ||||
| } | } | ||||
| if ($can_retry) { | if ($can_retry) { | ||||
| // New commit state here | // New commit state here | ||||
| $into_commit = '..'; | $into_commit = '..'; | ||||
| continue; | continue; | ||||
| } | } | ||||
| throw $ex; | throw new PhutilArgumentUsageException( | ||||
| $ex->getMessage()); | |||||
| } | } | ||||
| if ($need_cascade) { | if ($need_cascade) { | ||||
| // NOTE: We cascade each set we've pushed, but we're going to | // NOTE: We cascade each set we've pushed, but we're going to | ||||
| // cascade them from most recent to least recent. This way, | // cascade them from most recent to least recent. This way, | ||||
| // branches which descend from more recent changes only cascade | // branches which descend from more recent changes only cascade | ||||
| // once, directly in to the correct state. | // once, directly in to the correct state. | ||||
| ▲ Show 20 Lines • Show All 286 Lines • Show Last 20 Lines | |||||