Page MenuHomePhorge

D25029.1732326683.diff
No OneTemporary

D25029.1732326683.diff

diff --git a/src/repository/api/ArcanistGitAPI.php b/src/repository/api/ArcanistGitAPI.php
--- a/src/repository/api/ArcanistGitAPI.php
+++ b/src/repository/api/ArcanistGitAPI.php
@@ -189,6 +189,28 @@
list($commit, $tree, $parents, $time, $author, $author_email,
$title, $message) = explode("\1", trim($line), 8);
$message = rtrim($message);
+ $co_authors = array();
+
+ foreach (explode("\n", $message) as $message_line) {
+ if (strncasecmp($message_line, 'Co-authored-by:', 15) !== 0) {
+ continue;
+ }
+
+ $matches = array();
+ $status = preg_match(
+ '/^co-authored-by:\s*(.*)<(.*)>/i',
+ $message_line,
+ $matches);
+
+ if ($status !== 1) {
+ continue;
+ }
+
+ $co_authors[] = array(
+ 'name' => $matches[1],
+ 'email' => $matches[2],
+ );
+ }
$commits[$commit] = array(
'commit' => $commit,
@@ -199,6 +221,7 @@
'summary' => $title,
'message' => $message,
'authorEmail' => $author_email,
+ 'coAuthors' => $co_authors,
);
}
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
@@ -202,6 +202,7 @@
$parents, $desc) = explode("\1", $log, 9);
list($author, $author_email) = $this->parseFullAuthor($full_author);
+ $co_authors = array();
// NOTE: If a commit has only one parent, {parents} returns empty.
// If it has two parents, {parents} returns revs and short hashes, not
@@ -223,6 +224,28 @@
$node);
}
+
+ foreach (explode("\n", $desc) as $line) {
+ if (strncasecmp($line, 'Co-authored-by:', 15) !== 0) {
+ continue;
+ }
+
+ $matches = array();
+ $status = preg_match(
+ '/^co-authored-by:\s*(.*)<(.*)>/i',
+ $line,
+ $matches);
+
+ if ($status !== 1) {
+ continue;
+ }
+
+ $co_authors[] = array(
+ 'name' => $matches[1],
+ 'email' => $matches[2],
+ );
+ }
+
$commits[$node] = array(
'author' => $author,
'time' => strtotime($date),
@@ -235,6 +258,7 @@
'summary' => head(explode("\n", $desc)),
'message' => $desc,
'authorEmail' => $author_email,
+ 'coAuthors' => $co_authors,
);
$last_node = $node;
diff --git a/src/workflow/ArcanistWorkflow.php b/src/workflow/ArcanistWorkflow.php
--- a/src/workflow/ArcanistWorkflow.php
+++ b/src/workflow/ArcanistWorkflow.php
@@ -968,6 +968,11 @@
return $working_copy;
}
+ /**
+ * @param ArcanistRepositoryAPI<mixed> $api
+ *
+ * @return self<mixed>
+ */
final public function setRepositoryAPI($api) {
$this->repositoryAPI = $api;
return $this;
@@ -981,6 +986,9 @@
}
}
+ /**
+ * @return ArcanistRepositoryAPI<mixed>
+ */
final public function getRepositoryAPI() {
$configuration_engine = $this->getConfigurationEngine();
if ($configuration_engine) {

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 01:51 (11 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
989455
Default Alt Text
D25029.1732326683.diff (3 KB)

Event Timeline