import com.intellij.openapi.vfs.VirtualFile;
import org.apache.commons.lang.StringUtils;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.zmlx.hg4idea.HgFile;
import org.zmlx.hg4idea.HgRevisionNumber;
return doExecute(repo, null);
}
+ @Nullable
public HgChange execute(VirtualFile repo, @NotNull String file) {
Set<HgChange> changes = doExecute(repo, file);
return changes.isEmpty() ? null : changes.iterator().next();
HgCommandResult result = service.execute(repo, "status", arguments);
Set<HgChange> changes = new HashSet<HgChange>();
HgChange previous = null;
+ if (result == null) {
+ return changes;
+ }
for (String line : result.getOutputLines()) {
if (StringUtils.isBlank(line) || line.length() < ITEM_COUNT) {
LOG.warn("Unexpected line in status '" + line + '\'');