1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +01:00

Print out recovery command before running "git branch -D" in "arc land"

Summary: You can get this out of reflog, but we can easily just give you the
command in case you want to undo the -D.

Test Plan: Ran "arc land --hold" on this branch, used recovery command to
recover it.

Reviewers: cpiro, btrahan, jungejason

Reviewed By: cpiro

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1504
This commit is contained in:
epriestley 2012-01-26 17:59:42 -08:00
parent b1cd4f8efa
commit 02f111ba0b
2 changed files with 12 additions and 0 deletions

View file

@ -261,7 +261,18 @@ EOTEXT
}
if (!$this->getArgument('keep-branch')) {
list($ref) = execx(
'(cd %s && git rev-parse --verify %s)',
$repository_api->getPath(),
$branch);
$ref = trim($ref);
$recovery_command = csprintf(
'git checkout -b %s %s',
$branch,
$ref);
echo "Cleaning up feature branch...\n";
echo "(Use `{$recovery_command}` if you want it back.)\n";
execx(
'(cd %s && git branch -D %s)',
$repository_api->getPath(),

View file

@ -14,6 +14,7 @@ phutil_require_module('arcanist', 'workflow/base');
phutil_require_module('phutil', 'console');
phutil_require_module('phutil', 'future/exec');
phutil_require_module('phutil', 'utils');
phutil_require_module('phutil', 'xsprintf/csprintf');
phutil_require_source('ArcanistLandWorkflow.php');