1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-09-20 08:58:55 +02: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:
Jason Ge 2012-07-09 12:05:35 -07:00
parent e5992a44fb
commit 178b7346a1

View file

@ -110,14 +110,18 @@ EOTEXT
$info = array_filter(explode("\2", trim($info))); $info = array_filter(explode("\2", trim($info)));
foreach ($info as $line) { foreach ($info as $line) {
list($hash, $epoch, $tree, $text) = explode("\1", trim($line), 4); list($hash, $epoch, $tree, $text) = explode("\1", trim($line), 4);
$message = ArcanistDifferentialCommitMessage::newFromRawCorpus($text); try {
$id = $message->getRevisionID(); $message = ArcanistDifferentialCommitMessage::newFromRawCorpus($text);
$id = $message->getRevisionID();
$commit_map[$hash] = array( $commit_map[$hash] = array(
'epoch' => (int)$epoch, 'epoch' => (int)$epoch,
'tree' => $tree, 'tree' => $tree,
'revisionID' => $id, 'revisionID' => $id,
); );
} catch (ArcanistUsageException $ex) {
// In case of invalid commit message which fails the parsing, do noting.
}
} }
return $commit_map; return $commit_map;