Skip to content
Permalink
Browse files
10: Update git-skara update to show changes
Reviewed-by: rwestberg
  • Loading branch information
edvbld committed Jun 12, 2020
1 parent 646926f commit 96088f469fae1987c26255d9d01c96ec05706c02
Showing 1 changed file with 9 additions and 3 deletions.
@@ -24,6 +24,7 @@

import org.openjdk.skara.args.Main;
import org.openjdk.skara.vcs.Repository;
import org.openjdk.skara.vcs.openjdk.CommitMessageParsers;
import org.openjdk.skara.version.Version;

import java.io.IOException;
@@ -134,15 +135,20 @@ private static void update(String[] args) throws IOException, InterruptedExcepti
}

var head = repo.get().head();
System.out.print("Checking for updates ...");
System.out.println("Checking for updates ...");
repo.get().pull();
for (var s : repo.get().submodules()) {
repo.get().updateSubmodule(s);
}
var newHead = repo.get().head();

if (!head.equals(newHead)) {
System.out.println("updates downloaded");
System.out.println("Found the following updates:");
var commits = repo.get().commitMetadata(head, newHead);
for (var commit : commits) {
var message = CommitMessageParsers.v1.parse(commit);
System.out.println("- " + message.title());
}
System.out.println("Rebuilding ...");
var cmd = new ArrayList<String>();
if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
@@ -161,7 +167,7 @@ private static void update(String[] args) throws IOException, InterruptedExcepti
System.exit(1);
}
} else {
System.out.println("no updates found");
System.out.println("No updates found");
}
}

0 comments on commit 96088f4

Please sign in to comment.