mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-02-02 09:58:23 +01:00
Support invalid commit message in "arc branch"
Summary: when a commit message contains error which fails the parsing, we 'arc branch' fails. One sample commit message we saw contains Differential Revision: 363812, 367983, 370452 The author manually committed the code without a real revision. Test Plan: ran on the repo with problem commit and it succeeded. Reviewers: epriestley Reviewed By: epriestley CC: malmond, aran, Korvin Differential Revision: https://secure.phabricator.com/D2944
This commit is contained in:
parent
e5992a44fb
commit
178b7346a1
1 changed files with 11 additions and 7 deletions
|
@ -110,14 +110,18 @@ EOTEXT
|
|||
$info = array_filter(explode("\2", trim($info)));
|
||||
foreach ($info as $line) {
|
||||
list($hash, $epoch, $tree, $text) = explode("\1", trim($line), 4);
|
||||
$message = ArcanistDifferentialCommitMessage::newFromRawCorpus($text);
|
||||
$id = $message->getRevisionID();
|
||||
try {
|
||||
$message = ArcanistDifferentialCommitMessage::newFromRawCorpus($text);
|
||||
$id = $message->getRevisionID();
|
||||
|
||||
$commit_map[$hash] = array(
|
||||
'epoch' => (int)$epoch,
|
||||
'tree' => $tree,
|
||||
'revisionID' => $id,
|
||||
);
|
||||
$commit_map[$hash] = array(
|
||||
'epoch' => (int)$epoch,
|
||||
'tree' => $tree,
|
||||
'revisionID' => $id,
|
||||
);
|
||||
} catch (ArcanistUsageException $ex) {
|
||||
// In case of invalid commit message which fails the parsing, do noting.
|
||||
}
|
||||
}
|
||||
|
||||
return $commit_map;
|
||||
|
|
Loading…
Add table
Reference in a new issue