You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/05/29 20:11:54 UTC

[17/50] [abbrv] 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-218
Commit: 80f4ac2a3e31c681732cb144e14a614f6b8cb963
Parents: 4be517c
Author: null <null>
Authored: Wed May 27 21:18:54 2015 +0300
Committer: null <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;
     }
 }