Changeset View
Changeset View
Standalone View
Standalone View
src/land/engine/ArcanistMercurialLandEngine.php
Show First 20 Lines • Show All 828 Lines • ▼ Show 20 Lines | try { | ||||
$argv[] = hgsprintf('%s..%s', $min_commit, $max_commit); | $argv[] = hgsprintf('%s..%s', $min_commit, $max_commit); | ||||
$argv[] = '--logfile'; | $argv[] = '--logfile'; | ||||
$argv[] = '-'; | $argv[] = '-'; | ||||
$argv[] = '--keep'; | $argv[] = '--keep'; | ||||
$argv[] = '--collapse'; | $argv[] = '--collapse'; | ||||
$future = $api->execFutureLocal('rebase %Ls', $argv); | $future = $api->execFutureLocalWithExtension( | ||||
'rebase', | |||||
'rebase %Ls', | |||||
$argv); | |||||
$future->write($commit_message); | $future->write($commit_message); | ||||
$future->resolvex(); | $future->resolvex(); | ||||
} catch (CommandException $ex) { | } catch (CommandException $ex) { | ||||
// Aborting the rebase should restore the same state prior to running the | // Aborting the rebase should restore the same state prior to running the | ||||
// rebase command. | // rebase command. | ||||
$api->execManualLocal('rebase --abort'); | $api->execManualLocalWithExtension( | ||||
'rebase', | |||||
'rebase --abort'); | |||||
throw $ex; | throw $ex; | ||||
} | } | ||||
// Find all the bookmarks which pointed at commits we just rebased, and | // Find all the bookmarks which pointed at commits we just rebased, and | ||||
// put them back the way they were before rebasing moved them. We aren't | // put them back the way they were before rebasing moved them. We aren't | ||||
// deleting the old commits yet and don't want to move the bookmarks. | // deleting the old commits yet and don't want to move the bookmarks. | ||||
$obsolete_map = array(); | $obsolete_map = array(); | ||||
▲ Show 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | foreach ($child_hashes as $child_hash) { | ||||
if (!strlen($child_hash)) { | if (!strlen($child_hash)) { | ||||
continue; | continue; | ||||
} | } | ||||
// TODO: If the only heads which are descendants of this child will | // TODO: If the only heads which are descendants of this child will | ||||
// be deleted, we can skip this rebase? | // be deleted, we can skip this rebase? | ||||
try { | try { | ||||
$api->execxLocal( | $api->execxLocalWithExtension( | ||||
'rebase', | |||||
'rebase --source %s --dest %s --keep --keepbranches', | 'rebase --source %s --dest %s --keep --keepbranches', | ||||
$child_hash, | $child_hash, | ||||
$new_commit); | $new_commit); | ||||
} catch (CommandException $ex) { | } catch (CommandException $ex) { | ||||
// Aborting the rebase should restore the same state prior to running | // Aborting the rebase should restore the same state prior to running | ||||
// the rebase command. | // the rebase command. | ||||
$api->execManualLocal('rebase --abort'); | $api->execManualLocalWithExtension( | ||||
'rebase', | |||||
'rebase --abort'); | |||||
throw $ex; | throw $ex; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
protected function pruneBranches(array $sets) { | protected function pruneBranches(array $sets) { | ||||
assert_instances_of($sets, 'ArcanistLandCommitSet'); | assert_instances_of($sets, 'ArcanistLandCommitSet'); | ||||
▲ Show 20 Lines • Show All 194 Lines • Show Last 20 Lines |