gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1740457 - /gump/live/python/gump/core/update/git.py
Date Fri, 22 Apr 2016 07:34:28 GMT
Author: kkolinko
Date: Fri Apr 22 07:34:28 2016
New Revision: 1740457

URL: http://svn.apache.org/viewvc?rev=1740457&view=rev
Log:
Revert r1740429, as planned. Gump is running successfully.

Modified:
    gump/live/python/gump/core/update/git.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=1740457&r1=1740456&r2=1740457&view=diff
==============================================================================
--- gump/live/python/gump/core/update/git.py (original)
+++ gump/live/python/gump/core/update/git.py Fri Apr 22 07:34:28 2016
@@ -106,28 +106,25 @@ class GitUpdater(ScmUpdater):
             Run git branch and git config remote.origin.url
             to see whether the branch and URL match
         """
-        return (False, 'Unconditionally forcing a fresh working copy. This is a temporary
solution to clean stale checkouts and to update configuration of git. 2016-04-22.')
+        cmd = getCmdFromString('git branch',
+                               'check_workspace_branch_' + module.getName(), 
+                               module.getSourceControlStagingDirectory())
+        result = execute(cmd)
 
-#
-#       cmd = getCmdFromString('git branch',
-#                              'check_workspace_branch_' + module.getName(), 
-#                              module.getSourceControlStagingDirectory())
-#       result = execute(cmd)
-#
-#       if not result.isOk():
-#           return (False, 'git branch returned ' + str(result.exit_code))
-#       elif not result.hasOutput():
-#           return (False, 'git branch didn\'t return any output.')
-#
-#       current_branch = extract_URL(result, BRANCH_REGEX, 'git branch')
-#       if module.getScm().getBranch() != current_branch:
-#           return (False, 'Expected branch \'' + module.getScm().getBranch() \
-#                       + '\' but working copy was \'' + current_branch + '\'')
-#
-#       return match_workspace_template(module, 'git config remote.origin.url',
-#                                       lambda result:
-#                                           tailFileToString(result.getOutput(),
-#                                                            1).rstrip())
+        if not result.isOk():
+            return (False, 'git branch returned ' + str(result.exit_code))
+        elif not result.hasOutput():
+            return (False, 'git branch didn\'t return any output.')
+
+        current_branch = extract_URL(result, BRANCH_REGEX, 'git branch')
+        if module.getScm().getBranch() != current_branch:
+            return (False, 'Expected branch \'' + module.getScm().getBranch() \
+                        + '\' but working copy was \'' + current_branch + '\'')
+
+        return match_workspace_template(module, 'git config remote.origin.url',
+                                        lambda result:
+                                            tailFileToString(result.getOutput(),
+                                                             1).rstrip())
 
     def getPostProcessCommands(self, module, isUpdate):
         """



Mime
View raw message