gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1739543 - in /gump/live/python/gump/core/update: git.py scmupdater.py
Date Sun, 17 Apr 2016 04:26:15 GMT
Author: bodewig
Date: Sun Apr 17 04:26:15 2016
New Revision: 1739543

URL: http://svn.apache.org/viewvc?rev=1739543&view=rev
Log:
allow multiple commands to be run to post-process a working copy

Modified:
    gump/live/python/gump/core/update/git.py
    gump/live/python/gump/core/update/scmupdater.py

Modified: gump/live/python/gump/core/update/git.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/update/git.py?rev=1739543&r1=1739542&r2=1739543&view=diff
==============================================================================
--- gump/live/python/gump/core/update/git.py (original)
+++ gump/live/python/gump/core/update/git.py Sun Apr 17 04:26:15 2016
@@ -96,7 +96,7 @@ class GitUpdater(ScmUpdater):
                                             tailFileToString(result.getOutput(),
                                                              1).rstrip())
 
-    def getPostProcessCommand(self, module, isUpdate):
+    def getPostProcessCommands(self, module, isUpdate):
         """
         Run git submodule update --init if this has been an update,
         if it has been a clone command just before, its recursive flag
@@ -110,5 +110,5 @@ class GitUpdater(ScmUpdater):
             cmd.addParameter('--init')
             cmd.addParameter('--recursive')
             maybe_make_quiet(module, cmd)
-            return cmd
-        return None
+            return [cmd]
+        return []

Modified: gump/live/python/gump/core/update/scmupdater.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/update/scmupdater.py?rev=1739543&r1=1739542&r2=1739543&view=diff
==============================================================================
--- gump/live/python/gump/core/update/scmupdater.py (original)
+++ gump/live/python/gump/core/update/scmupdater.py Sun Apr 17 04:26:15 2016
@@ -143,8 +143,8 @@ class ScmUpdater(RunSpecific):
 
             if cmdResult.isOk():
                 # Execute any postprocessing that may be required
-                cmdPost = self.getPostProcessCommand(module, isUpdate)
-                if cmdPost:
+                cmdPosts = self.getPostProcessCommands(module, isUpdate)
+                for cmdPost in cmdPosts:
                     log.debug(module.getScm().getScmType().displayName + \
                               " Module PostProcess : " + \
                               module.getName() + ", Repository Name: " + \
@@ -153,6 +153,8 @@ class ScmUpdater(RunSpecific):
                     work = CommandWorkItem(WORK_TYPE_UPDATE, cmdPost, cmdResult)
                     module.performedWork(work)
                     module.repository.performedWork(work.clone())
+                    if not cmdResult.isOk():
+                        break
 
             # Update Context w/ Results
             if not cmdResult.isOk():
@@ -233,14 +235,14 @@ class ScmUpdater(RunSpecific):
         """
         return (True, '')
 
-    def getPostProcessCommand(self, module, isUpdate):
+    def getPostProcessCommands(self, module, isUpdate):
         """
-        Get a command that is supposed to post-process a checked-out
+        Get a list of commands that are supposed to post-process a checked-out
         or updated working copy.
 
-        This has been introduced in order to update git submodules and
+        This has first been introduced in order to update git submodules and
         is currently not used by any other scm updater.
 
-        This base implementation returns None
+        This base implementation returns an empty list.
         """
-        return None
+        return []



Mime
View raw message