use of org.zmlx.hg4idea.command.HgBranchesCommand in project intellij-community by JetBrains.
the class HgRepositoryImpl method update.
@Override
public void update() {
HgRepoInfo currentInfo = readRepoInfo();
// update only if something changed!!! if update every time - new log will be refreshed every time, too.
// Then blinking and do not work properly;
final Project project = getProject();
if (!project.isDisposed() && !currentInfo.equals(myInfo)) {
myInfo = currentInfo;
HgCommandResult branchCommandResult = new HgBranchesCommand(project, getRoot()).collectBranches();
if (branchCommandResult == null || branchCommandResult.getExitValue() != 0) {
// hg executable is not valid
LOG.warn("Could not collect hg opened branches.");
myOpenedBranches = myInfo.getBranches().keySet();
} else {
myOpenedBranches = HgBranchesCommand.collectNames(branchCommandResult);
}
HgUtil.executeOnPooledThread(new Runnable() {
public void run() {
if (!project.isDisposed()) {
project.getMessageBus().syncPublisher(HgVcs.STATUS_TOPIC).update(project, getRoot());
}
}
}, project);
}
}
Aggregations