Ticket #277: fixMercurialUpdate.diff

File fixMercurialUpdate.diff, 1.7 kB (added by bhearsum, 8 months ago)

fix mercurial checkouts with a revision

  • old-upstream-buildbot-mirror/buildbot/slave/commands.py

    old new  
    22042204        if os.path.exists(os.path.join(self.builder.basedir, 
    22052205                                       self.srcdir, ".buildbot-patched")): 
    22062206            return False 
    2207         # like Darcs, to check out a specific (old) revision, we have to do a 
    2208         # full checkout. TODO: I think 'hg pull' plus 'hg update' might work 
    2209         if self.revision: 
    2210             return False 
    22112207        return os.path.isdir(os.path.join(self.builder.basedir, 
    22122208                                          self.srcdir, ".hg")) 
    22132209 
    22142210    def doVCUpdate(self): 
    22152211        d = os.path.join(self.builder.basedir, self.srcdir) 
    2216         command = [self.vcexe, 'pull', '--update', '--verbose'] 
     2212        command = [self.vcexe, 'pull', '--verbose'] 
     2213        c = ShellCommand(self.builder, command, d, 
     2214                         sendRC=False, timeout=self.timeout, 
     2215                         keepStdout=True) 
     2216        self.command = c 
     2217        d = c.start() 
     2218        d.addCallback(self._doUpdate) 
     2219        return d 
     2220 
     2221    def _doUpdate(self, res): 
     2222        d = os.path.join(self.builder.basedir, self.srcdir) 
     2223        # 'hg pull' has already been run, now we need to update to a specific 
     2224        # revision if specified, or to the tip otherwise 
     2225        command = [self.vcexe, 'update'] 
    22172226        if self.args['revision']: 
    22182227            command.extend(['--rev', self.args['revision']]) 
    22192228        c = ShellCommand(self.builder, command, d,