1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-02-16 16:58:38 +01:00

fix 'arc feature' not creating bookmarks on mercurial

Summary:
The arc feature command wasn't actually creating bookmarks
on mercurial. It needs to call 'hg bookmark' instead of 'hg update'

Also removed an unnecessary hgsprintf since there were no arguments.

Test Plan:
Ran 'arc feature foo' and 'arc feature bar tip^'.
The former created a bookmark at my current location.
The latter created a bookmark at tip^ and moved me to that revision.

Reviewers: vrana, epriestley

Reviewed By: epriestley

CC: sid0, bos, dschleimer, aran, Korvin

Differential Revision: https://secure.phabricator.com/D5023
This commit is contained in:
durham 2013-02-20 20:06:16 -08:00
parent 01ec103297
commit 7f81058ead

View file

@ -105,9 +105,14 @@ EOTEXT
$command = 'checkout %s';
}
list($err, $stdout, $stderr) = $api->execManualLocal(
$command,
reset($names));
$err = 1;
$branches = $api->getAllBranches();
if (in_array(reset($names), ipull($branches, 'name'))) {
list($err, $stdout, $stderr) = $api->execManualLocal(
$command,
reset($names));
}
if ($err) {
$match = null;
@ -134,13 +139,17 @@ EOTEXT
if ($api instanceof ArcanistMercurialAPI) {
$rev = '';
if (isset($names[1])) {
$rev = csprintf('-r %s', hgsprintf($names[1]));
$rev = csprintf('-r %s', $names[1]);
}
$exec = $api->execManualLocal(
'update %C %s',
'bookmark %C %s',
$rev,
$names[0]);
if (!$exec[0] && isset($names[1])) {
$api->execxLocal('update %s', $names[0]);
}
} else {
$exec = $api->execManualLocal(
'checkout -b %Ls',