Skip to content
Permalink
Browse files
git-hg-export: use namespaces for unknown domains
Reviewed-by: rwestberg, erikj
  • Loading branch information
edvbld committed Apr 17, 2021
1 parent 3e1e805 commit db88caa88c3aabd2c21fac145f94cbc4eb0caa96
Showing 1 changed file with 21 additions and 3 deletions.
@@ -23,6 +23,8 @@
package org.openjdk.skara.cli;

import org.openjdk.skara.args.*;
import org.openjdk.skara.census.Census;
import org.openjdk.skara.jcheck.JCheckConfiguration;
import org.openjdk.skara.vcs.*;
import org.openjdk.skara.vcs.openjdk.*;
import org.openjdk.skara.version.Version;
@@ -91,10 +93,26 @@ public static void main(String[] args) throws IOException, InterruptedException

var c = commit.get();
var committer = c.committer();
if (committer.email() == null || !committer.email().endsWith("@openjdk.org")) {
die("committer is not an OpenJDK committer");
String username = null;
if (committer.email().endsWith("@openjdk.org")) {
username = committer.email().split("@")[0];
} else {
var jcheckConf = JCheckConfiguration.from(repo.get(), repo.get().head());
if (jcheckConf.isEmpty()) {
die("No .jcheck/conf file found");
}
var censusURI = jcheckConf.get().census().url();
var census = Census.from(censusURI);
var namespace = census.namespace("openjdk.org");
if (namespace == null) {
die("No namespace found for openjdk.org");
}
var localUsername = committer.email().split("@")[0];
username = namespace.get(localUsername).username();
if (username == null) {
die("No census name found for " + localUsername);
}
}
var username = committer.email().split("@")[0];
var date = c.committed();
var dateFormatter = DateTimeFormatter.ofPattern("EE MMM HH:mm:ss yyyy xx");

1 comment on commit db88caa

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on db88caa Apr 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.