Ticket #41: buildbot-svn-passwd.patch

File buildbot-svn-passwd.patch, 3.3 kB (added by leoh, 2 years ago)

Patch against 0.7.5 to let svn use --username and --password

  • buildbot-0.7.5/slave/commands.py

    old new  
    14341434    handled by SourceBase, this command reads the following keys: 
    14351435 
    14361436    ['svnurl'] (required): the SVN repository string 
     1437    ['username']    Username passed to the svn command 
     1438    ['password']    Password passed to the svn command 
    14371439    """ 
    14381440 
    14391441    header = "svn operation" 
     
    14431445        self.vcexe = getCommand("svn") 
    14441446        self.svnurl = args['svnurl'] 
    14451447        self.sourcedata = "%s\n" % self.svnurl 
     1448        self.username = args.get("username", None) 
     1449        self.password = args.get("password", None) 
    14461450 
    14471451    def sourcedirIsUpdateable(self): 
    14481452        if os.path.exists(os.path.join(self.builder.basedir, 
     
    14571461        d = os.path.join(self.builder.basedir, self.srcdir) 
    14581462        command = [self.vcexe, 'update', '--revision', str(revision), 
    14591463                   '--non-interactive'] 
     1464        if self.username: 
     1465            command += ['--username', self.username] 
     1466        if self.password: 
     1467            command += ['--password', self.password] 
    14601468        c = ShellCommand(self.builder, command, d, 
    14611469                         sendRC=False, timeout=self.timeout, 
    14621470                         keepStdout=True) 
     
    14681476        d = self.builder.basedir 
    14691477        if self.mode == "export": 
    14701478            command = [self.vcexe, 'export', '--revision', str(revision), 
    1471                        '--non-interactive', 
    1472                        self.svnurl, self.srcdir] 
     1479                       '--non-interactive'] 
    14731480        else: 
    14741481            # mode=='clobber', or copy/update on a broken workspace 
    14751482            command = [self.vcexe, 'checkout', '--revision', str(revision), 
    1476                        '--non-interactive', 
    1477                        self.svnurl, self.srcdir] 
     1483                       '--non-interactive'] 
     1484        if self.username: 
     1485            command += ['--username', self.username] 
     1486        if self.password: 
     1487            command += ['--password', self.password] 
     1488        command += [self.svnurl, self.srcdir] 
    14781489        c = ShellCommand(self.builder, command, d, 
    14791490                         sendRC=False, timeout=self.timeout, 
    14801491                         keepStdout=True) 
  • buildbot-0.7.5/steps/source.py

    old new  
    379379        self.svnurl = svnurl 
    380380        self.baseURL = baseURL 
    381381        self.branch = defaultBranch 
     382        self.username = kwargs.get("username")         
     383        if "username" in kwargs: 
     384            del kwargs["username"] 
     385        self.password = kwargs.get("password") 
     386        if "password" in kwargs: 
     387            del kwargs["password"] 
    382388 
    383389        Source.__init__(self, **kwargs) 
    384390 
     
    450456            self.args['svnurl'] = self.baseURL + branch 
    451457        self.args['revision'] = revision 
    452458        self.args['patch'] = patch 
     459        if self.username: 
     460            self.args['username'] = self.username 
     461        if self.password: 
     462            self.args['password'] = self.password 
    453463 
    454464        revstuff = [] 
    455465        if branch is not None and branch != self.branch: