Example #1
0
        def _parseIdentify(res):
            if res != 0:
                msg = "'hg identify' failed."
                self.sendStatus({'header': msg + "\n"})
                log.msg(msg)
                raise AbandonChain(-1)

            log.msg('Output: %s' % cmd.stdout)

            match = re.search(r'^(.+) (.+)$', cmd.stdout)
            if not match:
                msg = "'hg identify' did not give a recognizable output"
                self.sendStatus({'header': msg + "\n"})
                log.msg(msg)
                raise AbandonChain(-1)

            rev = match.group(1)
            current_branch = match.group(2)

            if rev == '-1':
                msg = "Fresh hg repo, don't worry about in-repo branch name"
                log.msg(msg)

            elif self.sourcedirIsPatched():
                self.clobber = self._purge

            elif self.update_branch != current_branch:
                msg = "Working dir is on in-repo branch '%s' and build needs '%s'." % (current_branch, self.update_branch)
                if self.clobberOnBranchChange:
                    msg += ' Cloberring.'
                else:
                    msg += ' Updating.'

                self.sendStatus({'header': msg + "\n"})
                log.msg(msg)

                # Clobbers only if clobberOnBranchChange is set
                if self.clobberOnBranchChange:
                    self.clobber = self._purge

            else:
                msg = "Working dir on same in-repo branch as build (%s)." % (current_branch)
                log.msg(msg)

            return 0
Example #2
0
 def _DownloadAbandon(self, dummy):
     self.sendStatus({"header": "abandonned due to merge failure\n"})
     raise AbandonChain(-1)
Example #3
0
 def maybeNotDoVCFallback(self, res):
     # If we were unable to find the branch/SHA on the remote,
     # clobbering the repo won't help any, so just abort the chain
     if hasattr(self.command, 'stderr'):
         if "Couldn't find remote ref" in self.command.stderr:
             raise AbandonChain(-1)