Ejemplo n.º 1
0
    def _run1(self, cmd, env=None, verbose=False, fold_stderr=True):
        """Run command, prune output, return just that.

        If fold_stderr is False, then ignore any stderr output.
        """
        if fold_stderr:
            rc, output = utils.run2(cmd, env=env, show_command=verbose)
        else:
            rc, output, errors = utils.run3(cmd, env=env, show_command=verbose)
        if rc:
            raise utils.ShellError(cmd, rc, output)
        else:
            return self._prune_spurious_bzr_output(output)
Ejemplo n.º 2
0
    def _run1(self, cmd, env=None, verbose=False, fold_stderr=True):
        """Run command, prune output, return just that.

        If fold_stderr is False, then ignore any stderr output.
        """
        if fold_stderr:
            rc, output = utils.run2(cmd, env=env, show_command=verbose)
        else:
            rc, output, errors = utils.run3(cmd, env=env, show_command=verbose)
        if rc:
            raise utils.ShellError(cmd, rc, output)
        else:
            return self._prune_spurious_bzr_output(output)
Ejemplo n.º 3
0
    def _calculate_revision(self, co_leaf, orig_revision):
        """
        This returns a bare SHA1 object name for orig_revision

        NB: if 'before' is specified, 'force' is ignored.
        """
        retcode, revision, ignore = utils.run3('git rev-parse %s'%orig_revision)
        if retcode:
            if revision:
                text = utils.indent(revision.strip(),'    ')
                raise GiveUp("%s\n%s"%(utils.wrap("%s: 'git rev-parse HEAD'"
                                                  " could not determine a revision id for checkout:"%co_leaf),
                                       text))
            else:
                raise GiveUp("%s\n"%(utils.wrap("%s: 'git rev-parse HEAD'"
                                                " could not determine a revision id for checkout:"%co_leaf)))
        return revision.strip()
Ejemplo n.º 4
0
    def _calculate_revision(self, co_leaf, orig_revision):
        """
        This returns a bare SHA1 object name for orig_revision

        NB: if 'before' is specified, 'force' is ignored.
        """
        retcode, revision, ignore = utils.run3('git rev-parse %s' %
                                               orig_revision)
        if retcode:
            if revision:
                text = utils.indent(revision.strip(), '    ')
                raise GiveUp("%s\n%s" % (utils.wrap(
                    "%s: 'git rev-parse HEAD'"
                    " could not determine a revision id for checkout:" %
                    co_leaf), text))
            else:
                raise GiveUp("%s\n" % (utils.wrap(
                    "%s: 'git rev-parse HEAD'"
                    " could not determine a revision id for checkout:" %
                    co_leaf)))
        return revision.strip()