Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-456 536275850 -> a4c88fedf


# ignite-456: removing of patches


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a4c88fed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a4c88fed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a4c88fed

Branch: refs/heads/ignite-456
Commit: a4c88fedfb0ae96ef7d1f8edddd4d41b9f06b80b
Parents: 5362758
Author: null <null>
Authored: Wed May 27 19:00:49 2015 +0300
Committer: null <null>
Committed: Wed May 27 19:00:49 2015 +0300

----------------------------------------------------------------------
 dev-tools/slurp.sh                         |  2 +-
 dev-tools/src/main/groovy/jiraslurp.groovy | 66 +++++++++++++++----------
 2 files changed, 40 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a4c88fed/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/a4c88fed/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 e4bb321..020c459 100644
--- a/dev-tools/src/main/groovy/jiraslurp.groovy
+++ b/dev-tools/src/main/groovy/jiraslurp.groovy
@@ -281,50 +281,62 @@ 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
+    patchFile << new URL("$ATTACHMENT_URL/$attachementURL/").text
 
-        println "Got patch content."
+    println "Got patch content."
 
-        try {
-            tryGitAmAbort()
+    try {
+        tryGitAmAbort()
 
-            execGit "git branch"
+        execGit "git branch"
 
-            execGit "git config user.email \"$userEmail\""
-            execGit "git config user.name \"$userName\""
+        execGit "git config user.email \"$userEmail\""
+        execGit "git config user.name \"$userName\""
 
-            // Create a new uniqueue branch to applying patch
-            def newTestBranch = 
"test-branch-${jira}-${attachementURL}-${System.currentTimeMillis()}"
-            execGit "git checkout -b ${newTestBranch}"
+        // 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"
 
-            println "Trying to apply patch."
+        println "Trying to apply patch."
 
-            execGit "git am dev-tools/${patchFile.name}"
+        execGit "git am dev-tools/${patchFile.name}"
 
-            println "Patch was applied successfully."
-        }
-        catch (Throwable e) {
-            println "Patch was not applied successfully. Aborting patch 
applying."
+        println "Patch was applied successfully."
+    }
+    catch (Throwable e) {
+        println "Patch was not applied successfully. Aborting patch applying."
 
-            tryGitAmAbort()
+        tryGitAmAbort()
 
-            throw e;
-        }
-    }
-    finally {
-        assert patchFile.delete(), 'Could not delete patch file.'
+        throw e;
     }
 }
 

Reply via email to