Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-hg-export: use namespaces for unknown domains #1122

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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");