gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject cvs commit: jakarta-gump/python/gump/model module.py
Date Thu, 05 Feb 2004 06:13:41 GMT
ajack       2004/02/04 22:13:41

  Modified:    python/gump/model module.py
  Log:
  Try to not crash on Stefan's workspace...
  
  Revision  Changes    Path
  1.30      +37 -34    jakarta-gump/python/gump/model/module.py
  
  Index: module.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/model/module.py,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- module.py	23 Jan 2004 23:32:26 -0000	1.29
  +++ module.py	5 Feb 2004 06:13:41 -0000	1.30
  @@ -308,47 +308,50 @@
                                  
           # :TODO: Consolidate this code, less cut-n-paste but also
           # check the 'type' of the repository is appropriate for the
  -        # use (eg. type='cvs' if refrenced by CVS).
  +        # use (eg. type='cvs' if referenced by CVS).
           if not packaged:
               # We have a CVS entry, expand it...
               if self.xml.cvs:
                   repoName=self.xml.cvs.repository
  -                if workspace.hasRepository(repoName):
  -                    # It references this repository...
  -                    repo=workspace.getRepository(repoName)
  -                    self.repository=repo
  -                    repo.addModule(self)
  -                    self.cvs=ModuleCvs(self.xml.cvs,repo)
  -                else:
  -                    self.changeState(STATE_FAILED,REASON_CONFIG_FAILED)               
  -                    self.addError('No such repository in w/s ['+ repoName +'] on [' \
  -                            + self.getName() + ']')
  +                if repoName:
  +                    if workspace.hasRepository(repoName):
  +                        # It references this repository...
  +                        repo=workspace.getRepository(repoName)
  +                        self.repository=repo
  +                        repo.addModule(self)
  +                        self.cvs=ModuleCvs(self.xml.cvs,repo)
  +                    else:
  +                        self.changeState(STATE_FAILED,REASON_CONFIG_FAILED)           
   
  +                        self.addError('No such repository in w/s ['+ str(repoName) +']
on [' \
  +                                + self.getName() + ']')
                               
               elif self.xml.svn:                
                   repoName=self.xml.svn.repository
  -                if workspace.hasRepository(repoName):
  -                    # It references this repository...
  -                    repo=workspace.getRepository(repoName)
  -                    self.repository=repo
  -                    repo.addModule(self)
  -                    self.svn=ModuleSvn(self.xml.svn,repo)
  -                else:
  -                    self.changeState(STATE_FAILED,REASON_CONFIG_FAILED)               
  -                    self.addError('No such repository in w/s ['+ repoName +'] on [' \
  -                            + self.getName() + ']')                 
  +                if repoName:
  +                    if workspace.hasRepository(repoName):
  +                        # It references this repository...
  +                        repo=workspace.getRepository(repoName)
  +                        self.repository=repo
  +                        repo.addModule(self)
  +                        self.svn=ModuleSvn(self.xml.svn,repo)
  +                    else:
  +                        self.changeState(STATE_FAILED,REASON_CONFIG_FAILED)           
   
  +                        self.addError('No such repository in w/s ['+ str(repoName) +']
on [' \
  +                                + self.getName() + ']')                 
                                                   
               elif self.xml.jars:                
                   repoName=self.xml.jars.repository
  -                if workspace.hasRepository(repoName):
  -                    # It references this repository...
  -                    repo=workspace.getRepository(repoName)
  -                    self.repository=repo
  -                    repo.addModule(self)
  -                    self.jars=ModuleJars(self.xml.jars,repo)
  -                else:
  -                    self.changeState(STATE_FAILED,REASON_CONFIG_FAILED)               
  -                    self.addError('No such repository in w/s ['+ repoName +'] on [' \
  -                            + self.getName() + ']')                 
  +                if repoName:
  +                    if workspace.hasRepository(repoName):
  +                        # It references this repository...
  +                        repo=workspace.getRepository(repoName)	
  +                        self.repository=repo	
  +                        repo.addModule(self)
  +                        self.jars=ModuleJars(self.xml.jars,repo)
  +                    else:
  +                        self.changeState(STATE_FAILED,REASON_CONFIG_FAILED)           
   
  +                        self.addError('No such repository in w/s ['+ str(repoName) +']
on [' \
  +                                + self.getName() + ']')                 
   
   
           # For prettiness
  
  
  

Mime
View raw message