Page MenuHomePhabricator

D19758.id47208.diff
No OneTemporary

D19758.id47208.diff

diff --git a/src/repository/api/ArcanistMercurialAPI.php b/src/repository/api/ArcanistMercurialAPI.php
--- a/src/repository/api/ArcanistMercurialAPI.php
+++ b/src/repository/api/ArcanistMercurialAPI.php
@@ -460,12 +460,16 @@
Filesystem::createDirectory(dirname($tmppath), 0755, true);
}
+ // NOTE: The "%s%%p" construction passes a literal "%p" to Mercurial,
+ // which is a formatting directive for a repo-relative filepath. The
+ // particulars of the construction avoid Windows escaping issues. See
+ // PHI904.
+
list($err, $stdout) = $this->execManualLocal(
- 'cat --rev %s --output %s -- %C',
+ 'cat --rev %s --output %s%%p -- %Ls',
$revision,
- // %p is the formatter for the repo-relative filepath
- $tmpdir.'/%p',
- implode(' ', $paths));
+ $tmpdir.DIRECTORY_SEPARATOR,
+ $paths);
$filedata = array();
foreach ($paths as $path) {

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 10:16 AM (17 h, 30 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6778153
Default Alt Text
D19758.id47208.diff (925 B)

Event Timeline