Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 84FC418281 for ; Thu, 28 May 2015 15:07:38 +0000 (UTC) Received: (qmail 88875 invoked by uid 500); 28 May 2015 15:07:38 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 88842 invoked by uid 500); 28 May 2015 15:07:38 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 88829 invoked by uid 99); 28 May 2015 15:07:38 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2015 15:07:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 0464E182202 for ; Thu, 28 May 2015 15:07:38 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.791 X-Spam-Level: * X-Spam-Status: No, score=1.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Nu6xazeFc9Ok for ; Thu, 28 May 2015 15:07:25 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id D27F247BC9 for ; Thu, 28 May 2015 15:07:23 +0000 (UTC) Received: (qmail 88400 invoked by uid 99); 28 May 2015 15:07:23 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2015 15:07:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DCFABE10A4; Thu, 28 May 2015 15:07:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sevdokimov@apache.org To: commits@ignite.incubator.apache.org Date: Thu, 28 May 2015 15:07:22 -0000 Message-Id: <75bb59ee58d1478cbe3daf1526dcf1c3@git.apache.org> In-Reply-To: <9d8bca8619bb4881b207399db29e6a07@git.apache.org> References: <9d8bca8619bb4881b207399db29e6a07@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/9] incubator-ignite git commit: # ignite-456: fix encoding issue # ignite-456: fix encoding issue Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/80f4ac2a Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/80f4ac2a Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/80f4ac2a Branch: refs/heads/ignite-943 Commit: 80f4ac2a3e31c681732cb144e14a614f6b8cb963 Parents: 4be517c Author: null Authored: Wed May 27 21:18:54 2015 +0300 Committer: null Committed: Wed May 27 21:18:54 2015 +0300 ---------------------------------------------------------------------- dev-tools/slurp.sh | 2 +- dev-tools/src/main/groovy/jiraslurp.groovy | 73 ++++++++++++++++--------- 2 files changed, 47 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/80f4ac2a/dev-tools/slurp.sh ---------------------------------------------------------------------- diff --git a/dev-tools/slurp.sh b/dev-tools/slurp.sh index 7eb6fdb..7edc776 100755 --- a/dev-tools/slurp.sh +++ b/dev-tools/slurp.sh @@ -52,7 +52,7 @@ TASK_RUNNER_USER='task_runner' TASK_RUNNER_PWD='' echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" -echo "<"$(date +"%H:%M:%S")"> Starting task triggering" +echo "<"$(date + "%D - %H:%M:%S")"> Starting task triggering" echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" # Useful settings http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/80f4ac2a/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 75a595f..3547337 100644 --- a/dev-tools/src/main/groovy/jiraslurp.groovy +++ b/dev-tools/src/main/groovy/jiraslurp.groovy @@ -45,7 +45,7 @@ def checkprocess = { process -> if (process.exitValue() != 0) { println "Return code: " + process.exitValue() - println "Errout:\n" + process.err.text +// println "Errout:\n" + process.err.text assert process.exitValue() == 0 || process.exitValue() == 128 } @@ -281,50 +281,69 @@ def tryGitAmAbort = { * Applys patch from jira to given git state. */ def applyPatch = { jira, attachementURL -> - def userEmail = System.getenv("env.GIT_USER_EMAIL"); - def userName = System.getenv("env.GIT_USER_NAME"); + // Delete all old IGNITE-*-*.patch files. + def directory = new File("./") + + println "Remove IGNITE-*-*.patch files in ${directory.absolutePath} and its subdirectories..." + + def classPattern = ~/.*IGNITE-.*-.*\.patch/ + + directory.eachFileRecurse(groovy.io.FileType.FILES) + { file -> + if (file ==~ classPattern){ + println "Deleting ${file}..." + file.delete() + } + } + + // Main logic. println "Patch apllying with jira='$jira' and attachment='$ATTACHMENT_URL/$attachementURL/'." + def userEmail = System.getenv("env.GIT_USER_EMAIL"); + def userName = System.getenv("env.GIT_USER_NAME"); + def patchFile = new File("${jira}-${attachementURL}.patch") - try { - println "Getting patch content." + println "Getting patch content." - patchFile << new URL("$ATTACHMENT_URL/$attachementURL/").text + def attachmentUrl = new URL("$ATTACHMENT_URL/$attachementURL/") - println "Got patch content." + HttpURLConnection conn = (HttpURLConnection)attachmentUrl.openConnection(); + conn.setRequestProperty("Content-Type", "text/x-patch;charset=utf-8"); + conn.setRequestProperty("X-Content-Type-Options", "nosniff"); + conn.connect(); - try { - tryGitAmAbort() + patchFile << conn.getInputStream() - execGit "git branch" + println "Got patch content." - execGit "git config user.email \"$userEmail\"" - execGit "git config user.name \"$userName\"" + try { + tryGitAmAbort() - // Create a new uniqueue branch to applying patch - def newTestBranch = "test-branch-${jira}-${attachementURL}-${System.currentTimeMillis()}" - execGit "git checkout -b ${newTestBranch}" + execGit "git branch" - execGit "git branch" + execGit "git config user.email \"$userEmail\"" + execGit "git config user.name \"$userName\"" - println "Trying to apply patch." + // Create a new uniqueue branch to applying patch + def newTestBranch = "test-branch-${jira}-${attachementURL}-${System.currentTimeMillis()}" + execGit "git checkout -b ${newTestBranch}" - execGit "git am dev-tools/${patchFile.name}" + execGit "git branch" - println "Patch was applied successfully." - } - catch (Throwable e) { - println "Patch was not applied successfully. Aborting patch applying." + println "Trying to apply patch." - tryGitAmAbort() + execGit "git am dev-tools/${patchFile.name}" - throw e; - } + println "Patch was applied successfully." } - finally { - assert patchFile.delete(), 'Could not delete patch file.' + catch (Throwable e) { + println "Patch was not applied successfully. Aborting patch applying." + + tryGitAmAbort() + + throw e; } }