# ignite-456: fix git am
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2715f5ea Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2715f5ea Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2715f5ea Branch: refs/heads/ignite-456 Commit: 2715f5eaa83d4e403d1e1bca5ff5147e573dc718 Parents: 16997ae Author: Artem Shutak <ashu...@gridgain.com> Authored: Mon May 18 16:12:15 2015 +0300 Committer: Artem Shutak <ashu...@gridgain.com> Committed: Mon May 18 16:12:15 2015 +0300 ---------------------------------------------------------------------- dev-tools/src/main/groovy/jiraslurp.groovy | 39 +++++++++---------------- 1 file changed, 13 insertions(+), 26 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2715f5ea/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 6d287bf..0971577 100644 --- a/dev-tools/src/main/groovy/jiraslurp.groovy +++ b/dev-tools/src/main/groovy/jiraslurp.groovy @@ -109,40 +109,27 @@ def checkprocess = { process -> } } -def create_gitbranch = { jira, attachementURL -> - println jira - GIT_REPO - println "$ATTACHMENT_URL/$attachementURL/" - - def patchFile = new File("${jira}.patch") - - patchFile << new URL("$ATTACHMENT_URL/$attachementURL/").text - - checkprocess "git clone --depth 1 $GIT_REPO".execute() - checkprocess "git checkout -b ignite-sprint-5 origin/ignite-sprint-5".execute(null, new File('incubator-ignite')) - checkprocess "git am ../${patchFile.name}".execute(null, new File('incubator-ignite')) - - patchFile.delete() -} - def applyPatch = { jira, attachementURL -> println jira println "$ATTACHMENT_URL/$attachementURL/" - def patchFile = new File("${jira}-${attachementURL}.patch") + try { + def patchFile = new File("${jira}-${attachementURL}.patch") - patchFile << new URL("$ATTACHMENT_URL/$attachementURL/").text + patchFile << new URL("$ATTACHMENT_URL/$attachementURL/").text - try { - checkprocess "git am ../${patchFile.name}".execute(null, new File('incubator-ignite')) - } - catch (Exception e) { - checkprocess "git am --abort".execute + try { + checkprocess "git am dev-tools/${patchFile.name}".execute(null, new File('incubator-ignite')) + } + catch (Exception e) { + checkprocess "git am --abort".execute - throw e; + throw e; + } + } + finally { + assert patchFile.delete(), 'Could not delete patch file.' } - - assert patchFile.delete(), 'Could not delete patch file.' } def JIRA_xml = { jiranum ->