ignite-456
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d2af9e25 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d2af9e25 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d2af9e25 Branch: refs/heads/ignite-921 Commit: d2af9e255922077ab5881579c27d363575a6c5df Parents: edf6ffc Author: artem.shutak <ashu...@gridgain.com> Authored: Mon May 25 18:55:14 2015 +0300 Committer: artem.shutak <ashu...@gridgain.com> Committed: Mon May 25 18:55:14 2015 +0300 ---------------------------------------------------------------------- dev-tools/slurp.sh | 2 -- dev-tools/src/main/groovy/jiraslurp.groovy | 30 ++++++++++++++++--------- 2 files changed, 20 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d2af9e25/dev-tools/slurp.sh ---------------------------------------------------------------------- diff --git a/dev-tools/slurp.sh b/dev-tools/slurp.sh index 12b91f3..1636f21 100755 --- a/dev-tools/slurp.sh +++ b/dev-tools/slurp.sh @@ -58,8 +58,6 @@ git checkout ${DEFAULT_BRANCH} git pull export TC_URL=${TC_URL} -export GIT_USER_NAME=${GIT_USER_NAME} -export GIT_USER_EMAIL=${GIT_USER_EMAIL} export JIRA_USER=${JIRA_USER} export JIRA_PWD=${JIRA_PWD} export TASK_RUNNER_PWD=${TASK_RUNNER_PWD} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d2af9e25/dev-tools/src/main/groovy/jiraslurp.groovy ---------------------------------------------------------------------- diff --git a/dev-tools/src/main/groovy/jiraslurp.groovy b/dev-tools/src/main/groovy/jiraslurp.groovy index 109dfc0..0920001 100644 --- a/dev-tools/src/main/groovy/jiraslurp.groovy +++ b/dev-tools/src/main/groovy/jiraslurp.groovy @@ -238,6 +238,19 @@ def findAttachments = { attachments } +def tryGitAmAbort = { + try { + checkprocess "git am --abort".execute(null, new File("../")) + + println "Succsessfull: git am --abort." + } + catch (Throwable e) { + println "Error: git am --abort fails: " + + e.printStackTrace() + } +} + /** * Applys patch from jira to given git state. */ @@ -254,7 +267,11 @@ def applyPatch = { jira, attachementURL -> patchFile << new URL("$ATTACHMENT_URL/$attachementURL/").text + println "Got patch content." + try { + tryGitAmAbort() + checkprocess "git branch".execute() checkprocess "git config user.email \"$userEmail\"".execute(null, new File("../")) @@ -266,6 +283,8 @@ def applyPatch = { jira, attachementURL -> checkprocess "git branch".execute() + println "Trying to apply patch." + checkprocess "git am dev-tools/${patchFile.name}".execute(null, new File("../")) println "Patch was applied successfully." @@ -273,16 +292,7 @@ def applyPatch = { jira, attachementURL -> catch (Exception e) { println "Patch was not applied successfully. Aborting patch applying." - try { - checkprocess "git am --abort".execute(null, new File("../")) - - print "Succsessfull: git am --abort." - } - catch (Exception e2) { - print "Error: git am --abort fails: " - - e2.printStackTrace() - } + tryGitAmAbort() throw e; }