Beispiel #1
0
def shcmd(cmd, input=None, check=True, keeperr=True):
    _, _, _, p = util.popen4(cmd)
    out, err = p.communicate(input)
    if check and p.returncode:
        raise error.Abort(cmd + ' error: ' + err)
    elif keeperr:
        out += err
    return out
Beispiel #2
0
 def revs(self):
     if self._revs:
         return self._revs
     raw = util.popen4('git rev-list %s..%s' % (self.old, self.new))[1]\
               .read()\
               .strip()
     if raw != '':
         return raw.split("\n")
     else:
         return []
Beispiel #3
0
    def __init__(self):
        self.reporoot = None
        if 'GIT_DIR' in os.environ:
            gitdir = os.environ["GIT_DIR"]
            self.reporoot = os.path.dirname(os.path.abspath(gitdir))
        else:
            self.reporoot = util.popen4("git rev-parse --show-toplevel")[1]\
                                .read()\
                                .strip()

        self._revs = None
 def connect(self, cachecommand):
     if self.pipeo:
         raise util.Abort(_("cache connection already open"))
     self.pipei, self.pipeo, self.pipee, self.subprocess = \
         util.popen4(cachecommand)
     self.connected = True
Beispiel #5
0
 def head(self):
     return util.popen4("git rev-parse HEAD")[1].read().strip()
Beispiel #6
0
 def commitmessagefor(self, rev):
     return util.popen4("git cat-file commit %s | sed '1,/^$/d'" % rev)[1]\
                 .read().strip()
Beispiel #7
0
 def commitmessagefor(self, rev):
     return util.popen4("hg log -r %s -T {desc}" % rev)[1].read()
Beispiel #8
0
 def connect(self, cachecommand):
     if self.pipeo:
         raise util.Abort(_("cache connection already open"))
     self.pipei, self.pipeo, self.pipee, self.subprocess = \
         util.popen4(cachecommand)
     self.connected = True