Merge remote-tracking branch 'origin/master'

This commit is contained in:
Ekaterina Tuzova
2013-12-02 19:24:55 +04:00
5 changed files with 24 additions and 8 deletions

View File

@@ -366,7 +366,6 @@ public abstract class CloudGitDeploymentRuntime<DC extends CloudDeploymentNameCo
if (GitUtil.hasLocalChanges(true, getProject(), myContentRoot)) {
GitSimpleHandler handler = new GitSimpleHandler(getProject(), myContentRoot, GitCommand.COMMIT);
handler.setSilent(false);
handler.addParameters("-a");
handler.addParameters("-m", "Deploy");
handler.endOptions();
handler.run();

View File

@@ -16,6 +16,7 @@
package git4idea.log;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.diagnostic.Attachment;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
@@ -24,6 +25,7 @@ import com.intellij.openapi.vcs.VcsKey;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.ArrayUtil;
import com.intellij.util.Consumer;
import com.intellij.util.ExceptionUtil;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.vcs.log.*;
@@ -138,11 +140,17 @@ public class GitLogProvider implements VcsLogProvider {
tagHandler.addParameters("--tags", "--no-walk", "--format=%H%d" + GitLogParser.RECORD_START_GIT, "--decorate=full");
String out = tagHandler.run();
Collection<VcsRef> refs = new ArrayList<VcsRef>();
for (String record : out.split(GitLogParser.RECORD_START)) {
if (!StringUtil.isEmptyOrSpaces(record)) {
refs.addAll(new RefParser(myVcsObjectsFactory).parseCommitRefs(record.trim(), root));
try {
for (String record : out.split(GitLogParser.RECORD_START)) {
if (!StringUtil.isEmptyOrSpaces(record)) {
refs.addAll(new RefParser(myVcsObjectsFactory).parseCommitRefs(record.trim(), root));
}
}
}
catch (Exception e) {
LOG.error("Error during tags parsing", new Attachment("stack_trace.txt", ExceptionUtil.getThrowableText(e)),
new Attachment("git_output.txt", out));
}
return refs;
}

View File

@@ -9,6 +9,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -28,6 +29,9 @@ class RefParser {
// e25b7d8f (HEAD, refs/remotes/origin/master, refs/remotes/origin/HEAD, refs/heads/master)
public List<VcsRef> parseCommitRefs(@NotNull String input, @NotNull VirtualFile root) {
int firstSpaceIndex = input.indexOf(' ');
if (firstSpaceIndex < 0) {
return Collections.emptyList();
}
String strHash = input.substring(0, firstSpaceIndex);
Hash hash = HashImpl.build(strHash);
String refPaths = input.substring(firstSpaceIndex + 2, input.length() - 1);

View File

@@ -65,7 +65,11 @@ public class RefParserTest {
);
}
@Test
public void noTagName() {
runTest("787ec72f340d740433ba068d4d58a6e58f6226bf", "");
}
private class TestLogObjectsFactory implements VcsLogObjectsFactory {
@NotNull
@Override

View File

@@ -94,7 +94,7 @@ public class GradleImplicitContributor implements GradleMethodContextContributor
checkForAvailableTasks(1, place.getText(), processor, state, place);
}
if (methodCallInfo.size() == 2) {
processAvailableTasks(methodCall, processor, state, place);
processAvailableTasks(methodCallInfo, methodCall, processor, state, place);
}
}
@@ -192,7 +192,7 @@ public class GradleImplicitContributor implements GradleMethodContextContributor
}
}
private static void processAvailableTasks(@NotNull String taskName,
private static void processAvailableTasks(List<String> methodCallInfo, @NotNull String taskName,
@NotNull PsiScopeProcessor processor,
@NotNull ResolveState state,
@NotNull PsiElement place) {
@@ -202,7 +202,8 @@ public class GradleImplicitContributor implements GradleMethodContextContributor
if (canBeMethodOf(GroovyPropertyUtils.getGetterNameNonBoolean(taskName), gradleApiProjectClass)) return;
final String className = BUILT_IN_TASKS.get(taskName);
if (className != null) {
GradleResolverUtil.processDeclarations(psiManager, processor, state, place, className);
GradleResolverUtil.processDeclarations(
methodCallInfo.size() > 0 ? methodCallInfo.get(0) : null, psiManager, processor, state, place, className);
}
}
}