Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14092968
D21344.id50812.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D21344.id50812.diff
View Options
diff --git a/src/land/engine/ArcanistLandEngine.php b/src/land/engine/ArcanistLandEngine.php
--- a/src/land/engine/ArcanistLandEngine.php
+++ b/src/land/engine/ArcanistLandEngine.php
@@ -1547,7 +1547,7 @@
return $sets;
}
- final protected function newPassthru($pattern /* , ... */) {
+ final protected function newPassthruCommand($pattern /* , ... */) {
$workflow = $this->getWorkflow();
$argv = func_get_args();
@@ -1560,6 +1560,16 @@
$command = $workflow->newCommand($passthru)
->setResolveOnError(true);
+ return $command;
+ }
+
+ final protected function newPassthru($pattern /* , ... */) {
+ $argv = func_get_args();
+
+ $command = call_user_func_array(
+ array($this, 'newPassthruCommand'),
+ $argv);
+
return $command->execute();
}
diff --git a/src/land/engine/ArcanistMercurialLandEngine.php b/src/land/engine/ArcanistMercurialLandEngine.php
--- a/src/land/engine/ArcanistMercurialLandEngine.php
+++ b/src/land/engine/ArcanistMercurialLandEngine.php
@@ -455,18 +455,20 @@
// NOTE: We're using passthru on this because it's a remote command and
// may prompt the user for credentials.
- // TODO: This is fairly silly/confusing to show to users in the common
- // case where it does not require credentials, particularly because the
- // actual command line is full of nonsense.
-
$tmpfile = new TempFile();
Filesystem::remove($tmpfile);
- $err = $this->newPassthru(
+ $command = $this->newPassthruCommand(
'%Ls arc-ls-remote --output %s -- %s',
$api->getMercurialExtensionArguments(),
phutil_string_cast($tmpfile),
$target->getRemote());
+
+ $command->setDisplayCommand(
+ 'hg ls-remote -- %s',
+ $target->getRemote());
+
+ $err = $command->execute();
if ($err) {
throw new Exception(
pht(
diff --git a/src/toolset/command/ArcanistCommand.php b/src/toolset/command/ArcanistCommand.php
--- a/src/toolset/command/ArcanistCommand.php
+++ b/src/toolset/command/ArcanistCommand.php
@@ -6,6 +6,7 @@
private $logEngine;
private $executableFuture;
private $resolveOnError = false;
+ private $displayCommand;
public function setExecutableFuture(PhutilExecutableFuture $future) {
$this->executableFuture = $future;
@@ -34,10 +35,27 @@
return $this->resolveOnError;
}
+ public function setDisplayCommand($pattern /* , ... */) {
+ $argv = func_get_args();
+ $command = call_user_func_array('csprintf', $argv);
+ $this->displayCommand = $command;
+ return $this;
+ }
+
+ public function getDisplayCommand() {
+ return $this->displayCommand;
+ }
+
public function execute() {
$log = $this->getLogEngine();
$future = $this->getExecutableFuture();
- $command = $future->getCommand();
+
+ $display_command = $this->getDisplayCommand();
+ if ($display_command !== null) {
+ $command = $display_command;
+ } else {
+ $command = $future->getCommand();
+ }
$log->writeNewline();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 8:47 AM (12 h, 52 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6788770
Default Alt Text
D21344.id50812.diff (2 KB)
Attached To
Mode
D21344: In "arc land" in Mercurial, show a tidier "ls-remote" command
Attached
Detach File
Event Timeline
Log In to Comment