gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1293538 - in /gump/trunk/python/gump/core: model/module.py update/git.py
Date Sat, 25 Feb 2012 07:28:53 GMT
Author: bodewig
Date: Sat Feb 25 07:28:52 2012
New Revision: 1293538

URL: http://svn.apache.org/viewvc?rev=1293538&view=rev
Log:
support for git branches

Modified:
    gump/trunk/python/gump/core/model/module.py
    gump/trunk/python/gump/core/update/git.py

Modified: gump/trunk/python/gump/core/model/module.py
URL: http://svn.apache.org/viewvc/gump/trunk/python/gump/core/model/module.py?rev=1293538&r1=1293537&r2=1293538&view=diff
==============================================================================
--- gump/trunk/python/gump/core/model/module.py (original)
+++ gump/trunk/python/gump/core/model/module.py Sat Feb 25 07:28:52 2012
@@ -26,7 +26,7 @@ from gump.core.model.misc import Resulta
 from gump.core.model.object import NamedModelObject, ModelObject
 from gump.core.model.project import Project, ProjectSummary
 from gump.core.model.repository import SCM_TYPE_ARTIFACTS, SCM_TYPE_CVS, \
-    SCM_TYPE_P4, SUPPORTED_SCMS
+    SCM_TYPE_GIT, SCM_TYPE_P4, SUPPORTED_SCMS
 from gump.core.model.state import REASON_CONFIG_FAILED, REASON_PACKAGE, \
     STATE_COMPLETE, STATE_FAILED
 from gump.core.model.stats import Statable, Statistics
@@ -48,6 +48,8 @@ def create_scm_instance(scm_type, dom, r
         return ModuleP4(dom, repo)
     elif scm_type == SCM_TYPE_ARTIFACTS:
         return ModuleArtifacts(dom, repo)
+    elif scm_type == SCM_TYPE_GIT:
+        return ModuleGit(dom, repo)
     return ModuleScm(dom, repo)
 
 
@@ -227,6 +229,17 @@ class ModuleArtifacts(ModelObject):
     def getGroup(self):
         return self.group
 
+class ModuleGit(ModuleScm):
+    """
+    Describes the properties of a module's <git element
+    """
+    def __init__(self, dom, repository):
+        ModuleScm.__init__(self,  dom,  repository)
+        self.branch = self.getDomAttributeValue('branch') or 'master'
+
+    def getBranch(self):
+        return self.branch
+
 class Module(NamedModelObject, Statable, Resultable, Positioned):
     """Set of Modules (which contain projects)"""
     def __init__(self, name, dom, owner):

Modified: gump/trunk/python/gump/core/update/git.py
URL: http://svn.apache.org/viewvc/gump/trunk/python/gump/core/update/git.py?rev=1293538&r1=1293537&r2=1293538&view=diff
==============================================================================
--- gump/trunk/python/gump/core/update/git.py (original)
+++ gump/trunk/python/gump/core/update/git.py Sat Feb 25 07:28:52 2012
@@ -47,6 +47,8 @@ class GitUpdater(ScmUpdater):
                   module.getWorkspace().getSourceControlStagingDirectory())
         cmd.addParameter('clone')
         maybe_make_quiet(module, cmd)
+        cmd.addParameter('--branch')
+        cmd.addParameter(module.getScm().getBranch())
         cmd.addParameter(module.getScm().getRootUrl())
         cmd.addParameter(module.getName())
         return cmd
@@ -61,6 +63,7 @@ class GitUpdater(ScmUpdater):
         cmd.addParameter('pull')
         maybe_make_quiet(module, cmd)
         cmd.addParameter(module.getScm().getRootUrl())
+        cmd.addParameter(module.getScm().getBranch())
         return cmd
 
     def workspaceMatchesModule(self, module):



Mime
View raw message