Differential D14347 Diff 34632 src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
| Show First 20 Lines • Show All 425 Lines • ▼ Show 20 Lines | private function applyMerge( | ||||
| $src_ref = $merge['src.ref']; | $src_ref = $merge['src.ref']; | ||||
| $interface->execx( | $interface->execx( | ||||
| 'git fetch --no-tags -- %s +%s:%s', | 'git fetch --no-tags -- %s +%s:%s', | ||||
| $src_uri, | $src_uri, | ||||
| $src_ref, | $src_ref, | ||||
| $src_ref); | $src_ref); | ||||
| $command = csprintf( | // NOTE: This can never actually generate a commit because we pass | ||||
| 'git merge --no-stat --squash -- %R', | // "--squash", but git sometimes runs code to check that a username and | ||||
| // email are configured anyway. | |||||
| $real_command = csprintf( | |||||
| 'git -c user.name=%s -c user.email=%s merge --no-stat --squash -- %R', | |||||
| 'drydock', | |||||
| 'drydock@phabricator', | |||||
| $src_ref); | |||||
| // Show the user a simplified command if the operation fails and we need to | |||||
| // report an error. | |||||
| $show_command = csprintf( | |||||
| 'git merge --squash -- %R', | |||||
| $src_ref); | $src_ref); | ||||
| try { | try { | ||||
| $interface->execx('%C', $command); | $interface->execx('%C', $real_command); | ||||
| } catch (CommandException $ex) { | } catch (CommandException $ex) { | ||||
| $this->setWorkingCopyVCSErrorFromCommandException( | $this->setWorkingCopyVCSErrorFromCommandException( | ||||
| $lease, | $lease, | ||||
| self::PHASE_SQUASHMERGE, | self::PHASE_SQUASHMERGE, | ||||
| $command, | $show_command, | ||||
| $ex); | $ex); | ||||
| throw $ex; | throw $ex; | ||||
| } | } | ||||
| } | } | ||||
| protected function setWorkingCopyVCSErrorFromCommandException( | protected function setWorkingCopyVCSErrorFromCommandException( | ||||
| DrydockLease $lease, | DrydockLease $lease, | ||||
| Show All 26 Lines | |||||