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

hg: allow tags without email #729

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

Filter by extension

Filter by extension

Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -650,7 +650,9 @@ public Hash amend(String message, String authorName, String authorEmail, String

public Tag tag(Hash hash, String name, String message, String authorName, String authorEmail) throws IOException {
var user = authorName + " <" + authorEmail + ">";
var user = authorEmail != null ?
authorName + " <" + authorEmail + ">" :
try (var p = capture("hg", "tag",
"--message", message,
"--user", user,
@@ -2409,4 +2409,19 @@ void testMergeCommitWithRenamedP0AndModifiedP1(VCS vcs) throws IOException {

void testMercurialTagWithoutEmail() throws IOException, InterruptedException {
try (var dir = new TemporaryDirectory()) {
var repo = Repository.init(dir.path(), VCS.HG);
var readme = dir.path().resolve("README");
Files.write(readme, List.of("Hello, readme!"));
var head = repo.commit("Add README", "author", "");
var tag = repo.tag(head, "1.0", "Add tag 1.0", "duke", null);
var annotated = repo.annotate(tag).orElseThrow();