gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: rev 47403 - in gump/trunk: python/gump/model python/gump/test python/gump/update src/documentation/content/xdocs/metadata
Date Tue, 28 Sep 2004 15:04:57 GMT
Author: ajack
Date: Tue Sep 28 08:04:56 2004
New Revision: 47403

Modified:
   gump/trunk/python/gump/model/repository.py
   gump/trunk/python/gump/test/model.py
   gump/trunk/python/gump/update/svn.py
   gump/trunk/src/documentation/content/xdocs/metadata/repository.xml
Log:
Allow <user> and <password> under a <repository type="svn".

Modified: gump/trunk/python/gump/model/repository.py
==============================================================================
--- gump/trunk/python/gump/model/repository.py	(original)
+++ gump/trunk/python/gump/model/repository.py	Tue Sep 28 08:04:56 2004
@@ -59,6 +59,8 @@
             else:
                 raise RuntimeError, 'No URL on SVN repository: ' + self.getName()
             self.web=self.getDomChildValue('web')
+            self.user=self.getDomChildValue('user')            
+            self.password=self.getDomChildValue('password')
         elif 'artifact'==type:
             self.type='Artifacts'
             if self.hasDomChild('url'):
@@ -118,11 +120,29 @@
         # Existence means 'true'
         return self.hasDomChild('redistributable')
         
-    def hasUser(self): return hasattr(self,'user')
-    def hasPassword(self): return hasattr(self,'password')
-    def hasPath(self): return hasattr(self,'path')
-    def hasMethod(self): return hasattr(self,'method')
-    def hasHostname(self): return hasattr(self,'hostname')   
+    def hasUser(self): 
+        if hasattr(self,'user'):
+            if self.user: return True            
+        return False
+    def hasPassword(self):        
+        if hasattr(self,'password'):
+            if self.password: return True            
+        return False
+        
+    def hasPath(self): 
+        if hasattr(self,'path'):
+            if self.path: return True            
+        return False
+        
+    def hasMethod(self):
+        if hasattr(self,'method'):
+            if self.method: return True            
+        return False
+        
+    def hasHostname(self): 
+        if hasattr(self,'hostname'):
+            if self.hostname: return True            
+        return False
     
     def getTitle(self): return self.getDomAttributeValue('title')
     def getHomePage(self): return self.getDomAttributeValue('home-page')

Modified: gump/trunk/python/gump/test/model.py
==============================================================================
--- gump/trunk/python/gump/test/model.py	(original)
+++ gump/trunk/python/gump/test/model.py	Tue Sep 28 08:04:56 2004
@@ -132,6 +132,10 @@
         repo2 = self.workspace.getRepository('svn_repository1')  
         self.assertNonZeroString('Repository SVN URL',repo2.getUrl())
         self.assertNonZeroString('Repository Web URL',repo2.getWeb())
+        self.assertFalse('Repository has Username',repo2.hasUser())
+        self.assertNone('Repository Username',repo2.getUser())
+        self.assertFalse('Repository has Password',repo2.hasPassword())
+        self.assertNone('Repository Password',repo2.getPassword())
 
     def testComparisons(self):
         project1 = self.project1

Modified: gump/trunk/python/gump/update/svn.py
==============================================================================
--- gump/trunk/python/gump/update/svn.py	(original)
+++ gump/trunk/python/gump/update/svn.py	Tue Sep 28 08:04:56 2004
@@ -197,12 +197,14 @@
             Build the appropriate SVN command for checkout/update
         """
         
+        repository=module.repository
+        
         log.debug("SubVersion  Module Update : " + module.getName() + \
-                       ", Repository Name: " + str(module.repository.getName()))
+                       ", Repository Name: " + str(repository.getName()))
                                         
         url=module.svn.getRootUrl()
       
-        log.debug("SVN URL: [" + url + "] on Repository: " + module.repository.getName())
+        log.debug("SVN URL: [" + url + "] on Repository: " + repository.getName())
      
         #
         # Prepare SVN checkout/update command...
@@ -232,14 +234,19 @@
             cmd.addParameter('update')
         else:
             # do an SVN checkout
-            cmd.addParameter('checkout')
-            cmd.addParameter(url)
+            cmd.addParameter('checkout', url)
        
         #
         # Request non-interactive
         #
         cmd.addParameter('--non-interactive')
 
+        # Optional username/password
+        if repository.hasUser():
+            cmd.addParameter('--username', repository.getUser())    
+        if repository.hasPassword():
+            cmd.addParameter('--password', repository.getPassword())
+            
         #
         # If module name != SVN directory, tell SVN to put it into
         # a directory named after our module
@@ -248,7 +255,6 @@
             if not module.svn.getDir() == module.getName():
                 cmd.addParameter(module.getName())
         
-
         return (module.repository, url, cmd)
          
     

Modified: gump/trunk/src/documentation/content/xdocs/metadata/repository.xml
==============================================================================
--- gump/trunk/src/documentation/content/xdocs/metadata/repository.xml	(original)
+++ gump/trunk/src/documentation/content/xdocs/metadata/repository.xml	Tue Sep 28 08:04:56
2004
@@ -134,6 +134,41 @@
       </table>
     </section>
 	</section>
+		<section>
+		<title>SVN Usage</title><note>This is for type='svn' only.</note>
+			<p>This specifies all of the elements which are combined to form
+      an SVN command line  They are split out into separate entities so that each
+      can be individually overridden in a workspace definition.  When an
+      entity is listed as required below, it means that when all of the
+      definitions are combined the entity must have a value - a workspace
+      or profile, for example, only needs to contain the values which it
+      overrides.</p>
+
+      <table>
+        <tr>
+          <th>Entity</th>
+          <th>Description</th>
+          <th>Required?</th>
+        </tr>
+        <tr>
+          <td>url</td>
+          <td>This is the base URL for all modules that reside within this repository.

+			The <link href="module.html">module</link>'s &lt;svn <strong>dir</strong>
attribute
+			if appended to this base url.</td>
+          <td>Yes</td>
+        </tr>
+        <tr>
+          <td>user</td>
+          <td>The username for this SVN repository. If blank, defaults to 'anonymous'
access.</td>
+          <td>No</td>
+        </tr>
+        <tr>
+          <td>password</td>
+          <td>The password (in plain text, use cautiously!). If blank, defaults to
'anonymous' access.</td>
+          <td>No</td>
+        </tr>
+      </table>
+	</section>
 	<section>
 		<title>Perforce Usage</title>
 		<section><title>root</title>

Mime
View raw message