Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15519324
D8078.id18276.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
798 B
Referenced Files
None
Subscribers
None
D8078.id18276.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
@@ -323,14 +323,16 @@
$this->getBaseCommit(),
$path);
+ $lines = phutil_split_lines($stdout, $retain_line_endings = true);
+
$blame = array();
- foreach (explode("\n", trim($stdout)) as $line) {
+ foreach ($lines as $line) {
if (!strlen($line)) {
continue;
}
$matches = null;
- $ok = preg_match('/^\s*([^:]+?) [a-f0-9]{12}: (.*)$/', $line, $matches);
+ $ok = preg_match('/^\s*([^:]+?) ([a-f0-9]{12}):/', $line, $matches);
if (!$ok) {
throw new Exception("Unable to parse Mercurial blame line: {$line}");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 20, 9:44 PM (6 d, 11 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7740007
Default Alt Text
D8078.id18276.diff (798 B)
Attached To
Mode
D8078: Don't choke on blame of files with whitespace-only trailing lines
Attached
Detach File
Event Timeline
Log In to Comment