Ticket #263: mercurial_copy_with_archive.diff

File mercurial_copy_with_archive.diff, 1.3 kB (added by Almad, 8 months ago)

hg archive instead of cp -rp for mercurial backend

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

    old new  
    23202320        d.addCallback(_parse) 
    23212321        return d 
    23222322 
     2323    def doCopy(self, res): 
     2324        # now copy tree to workdir 
     2325        # we can do it via hg archive as we don't need active workdir there 
     2326        fromdir = os.path.join(self.builder.basedir, self.srcdir) 
     2327        todir = os.path.join(self.builder.basedir, self.workdir) 
     2328 
     2329        # I'd use from mercurial.dispatch import dispatch ; dispatch(['archive', todir]), 
     2330        # but whole buildbot seems to use console commands, 
     2331        # so we're going to use it here too  
     2332         
     2333        command = [self.vcexe, "archive", todir] 
     2334 
     2335        c = ShellCommand(self.builder, command, fromdir, 
     2336                         sendRC=False, timeout=self.timeout) 
     2337        self.command = c 
     2338        d = c.start() 
     2339        d.addCallback(self._abandonOnFailure) 
     2340        return d 
     2341 
    23232342registerSlaveCommand("hg", Mercurial, command_version) 
    23242343 
    23252344