final String prjName = projName;
final Repository repo = git.getRepository(root);
RequestProcessor rp = git.getRequestProcessor(root.getAbsolutePath());
GitProgressSupport supportCreate = new GitProgressSupport() {
public void perform() {
try {
OutputLogger logger = getLogger();
logger.outputInRed(
NbBundle.getMessage(InitAction.class,
"MSG_CREATE_TITLE")); // NOI18N
logger.outputInRed(
NbBundle.getMessage(InitAction.class,
"MSG_CREATE_TITLE_SEP")); // NOI18N
logger.output(
NbBundle.getMessage(InitAction.class,
"MSG_CREATE_INIT", prjName, root)); // NOI18N
repo.create();
} catch (IOException ex) {
notifyLater(ex);
}
}
};
supportCreate.start(rp, root.getAbsolutePath(),
org.openide.util.NbBundle.getMessage(InitAction.class, "MSG_Create_Progress")); // NOI18N
GitProgressSupport supportAdd = new GitProgressSupport() {
public void perform() {
OutputLogger logger = getLogger();
try {
List<File> files = getFileList(repo, root);
IndexBuilder.create(repo).
log(logger).
addAll(files).
write();
logger.output(
NbBundle.getMessage(InitAction.class,
"MSG_CREATE_ADD", files.size(), root.getAbsolutePath())); // NOI18N
logger.output(""); // NOI18N
logger.outputInRed(NbBundle.getMessage(InitAction.class, "MSG_CREATE_DONE_WARNING")); // NOI18N
} catch (IOException ex) {
notifyLater(ex);
} finally {
logger.outputInRed(NbBundle.getMessage(InitAction.class, "MSG_CREATE_DONE")); // NOI18N
logger.output(""); // NOI18N
}
}
};
supportAdd.start(rp, root.getAbsolutePath(),
org.openide.util.NbBundle.getMessage(InitAction.class, "MSG_Create_Add_Progress")); // NOI18N
GitProgressSupport supportStatus = new StatusTask(context) {
@Override
public void performAfter() {
git.versionedFilesChanged();
git.refreshAllAnnotations();
}
};
supportStatus.start(rp, root.getAbsolutePath(),
NbBundle.getMessage(InitAction.class, "MSG_Create_Status_Progress")); // NOI18N
}