You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gump.apache.org by bo...@apache.org on 2009/02/25 05:54:17 UTC

svn commit: r747656 - in /gump/trunk/python/gump/core/update: scmupdater.py svn.py

Author: bodewig
Date: Wed Feb 25 04:54:17 2009
New Revision: 747656

URL: http://svn.apache.org/viewvc?rev=747656&view=rev
Log:
Make svn detect a bad working copy

Modified:
    gump/trunk/python/gump/core/update/scmupdater.py
    gump/trunk/python/gump/core/update/svn.py

Modified: gump/trunk/python/gump/core/update/scmupdater.py
URL: http://svn.apache.org/viewvc/gump/trunk/python/gump/core/update/scmupdater.py?rev=747656&r1=747655&r2=747656&view=diff
==============================================================================
--- gump/trunk/python/gump/core/update/scmupdater.py (original)
+++ gump/trunk/python/gump/core/update/scmupdater.py Wed Feb 25 04:54:17 2009
@@ -20,9 +20,10 @@
 
 from gump import log
 
-from gump.core.model.workspace import CommandWorkItem, execute, \
+from gump.core.model.workspace import CommandWorkItem, \
     REASON_UPDATE_FAILED, STATE_FAILED, STATE_SUCCESS, WORK_TYPE_UPDATE
 from gump.core.run.gumprun import RunSpecific
+from gump.util.process.launcher import execute
 from gump.util.tools import wipeDirectoryTree
 
 def should_be_quiet(module):

Modified: gump/trunk/python/gump/core/update/svn.py
URL: http://svn.apache.org/viewvc/gump/trunk/python/gump/core/update/svn.py?rev=747656&r1=747655&r2=747656&view=diff
==============================================================================
--- gump/trunk/python/gump/core/update/svn.py (original)
+++ gump/trunk/python/gump/core/update/svn.py Wed Feb 25 04:54:17 2009
@@ -16,9 +16,14 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import re
+import StringIO
+
 from gump import log
-from gump.core.model.workspace import Cmd
 from gump.core.update.scmupdater import ScmUpdater, should_be_quiet
+from gump.util.process.command import Cmd
+from gump.util.process.launcher import execute
+from gump.util.tools import catFile
 
 def getCommand(module, forUpdate):
     """
@@ -68,6 +73,8 @@
         
     return cmd
 
+URL_REGEX = re.compile('^URL:\s+(.*)\s*$', re.MULTILINE | re.UNICODE)
+
 ###############################################################################
 # Classes
 ###############################################################################
@@ -93,3 +100,35 @@
         """
         return getCommand(module, True)
 
+    def workspaceMatchesModule(self, module):
+        """
+            Run svn info to see whether the URL matches
+        """
+        cmd = Cmd('svn', 'check_workspace_' + module.getName(), 
+                  module.getSourceControlStagingDirectory())
+        cmd.addParameter('info')
+
+        result = execute(cmd)
+
+        output = None
+        if result.hasOutput():
+            stream = StringIO.StringIO()
+            catFile(stream, result.getOutput())
+            output = stream.getvalue()
+            stream.close()
+
+        if not result.isOk():
+            return (False, 'svn info returned ' + str(result.exit_code))
+
+        elif not output:
+            return (False, 'svn info didn\'t return any output.')
+
+        match = URL_REGEX.search(output)
+        if not match:
+            return (False, 'Couldn\'t find URL in svn info output ' + output)
+
+        expectedURL = module.getScm().getRootUrl()
+        actualURL = match.group(1)
+
+        return (expectedURL == actualURL, 'Expected URL \'' + expectedURL + \
+                    '\' but working copy was \'' + actualURL + '\'')



Re: svn commit: r747656 - in /gump/trunk/python/gump/core/update: scmupdater.py svn.py

Posted by Stefan Bodewig <bo...@apache.org>.
On 2009-02-25, <bo...@apache.org> wrote:

> URL: http://svn.apache.org/viewvc?rev=747656&view=rev
> Log:
> Make svn detect a bad working copy

This means that on the Solaris zone a directory that is not a svn
working copy or that is a working copy of a different URL than the
configured one will be replaced.

This should happen for the very next Gump run on helios and the "rat"
module since rat's trunk just moved up a directory in svn.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org