Summary:
Fixes T4596. I misunderstood this issue and D8512 was not correct. Specifically:
- The `hg log` needs to be escaped, since otherwise "arcpatch-x" is interpreted as a revset.
- The `hg update` does not need to be escaped, since updating to a revset doesn't make sense and the command never treats its argument as a revset.
- The `hg bookmark` does not need to be escaped, for similar reasons.
Test Plan:
- Ran these commands in isolation and got sensible, consistent results.
- Ran `arc patch` several times in a row and got proper bookmark names.
Reviewers: btrahan, durham, rvanvelzen
Reviewed By: rvanvelzen
Subscribers: epriestley
Maniphest Tasks: T4596
Differential Revision: https://secure.phabricator.com/D8661
list($err) = $repository_api->execManualLocal(
'log -r %s',
- $proposed_name);
+ hgsprintf('%s', $proposed_name));
// no error means hg log found a bookmark
if (!$err) {
echo "Updating to the revision's base commit\n";
$repository_api->execPassthru(
'update %s',
- hgsprintf('%s', $base_revision));
+ $base_revision);
}
$repository_api->execxLocal(
'bookmark %s',
- hgsprintf('%s', $branch_name));
+ $branch_name);
echo phutil_console_format(
"Created and checked out bookmark %s.\n",