Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14079881
D19758.id47208.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
925 B
Referenced Files
None
Subscribers
None
D19758.id47208.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D19758: Work around a Windows escaping issue and security conecern in "hg cat --output ..."
Attached
Detach File
Event Timeline
Log In to Comment