Ejemplo n.º 1
0
 def getConfig(key):
     (returncode, stdout,
      stderr) = subprocessExtras.callCollectOutput(
          [self.__gitExecutable, "config", "--get", key])
     if returncode == 0:
         return stdout
     else:
         return None
Ejemplo n.º 2
0
 def runCollectOutput(self,args,eatStderr=False):
   """
   Run git with the given command line arguments and return a tuple with (returncode,output).
   """
   try:
     gitArgs = [self.getGitExecutable()]+args
     (returncode,stdout,stderr) = subprocessExtras.callCollectOutput(gitArgs,cwd=self.getPath())
     self.getUser().getRegistry().log(self.getPath()+": "+" ".join(gitArgs),verbosityLevel=3)
     self.getUser().getRegistry().log(stderr,verbosityLevel=3)
     if stderr and not eatStderr:
       raise Exception(stderr)
     return (returncode,stdout)
   except OSError as e:
     if e.errno == errno.EEXIST:
       sys.exit("You must have git installed to use subuser.")
     else:
       raise e
Ejemplo n.º 3
0
 def run(self,args):
   """
   Run git with the given command line arguments.
   """
   try:
     gitArgs = ["git"]+args
     (returncode,stdout,stderr) = subprocessExtras.callCollectOutput(gitArgs,cwd=self.getPath())
     self.getUser().getRegistry().log(self.getPath()+": "+" ".join(gitArgs),verbosityLevel=3)
     self.getUser().getRegistry().log(stdout,verbosityLevel=3)
     self.getUser().getRegistry().log(stderr,verbosityLevel=3)
     if stderr:
       raise Exception(stderr)
     return returncode
   except OSError as e:
     if e.errno == errno.EEXIST:
       sys.exit("You must have git installed to use subuser.")
     else:
       raise e
Ejemplo n.º 4
0
 def runCollectOutput(self, args, eatStderr=False):
     """
 Run git with the given command line arguments and return a tuple with (returncode,output).
 """
     try:
         gitArgs = [self.getGitExecutable()] + args
         (returncode, stdout,
          stderr) = subprocessExtras.callCollectOutput(gitArgs,
                                                       cwd=self.getPath())
         self.getUser().getRegistry().log(self.getPath() + ": " +
                                          " ".join(gitArgs),
                                          verbosityLevel=3)
         self.getUser().getRegistry().log(stderr, verbosityLevel=3)
         if stderr and not eatStderr:
             raise GitException(stderr)
         return (returncode, stdout)
     except OSError as e:
         if e.errno == errno.EEXIST:
             sys.exit("You must have git installed to use subuser.")
         else:
             raise e
Ejemplo n.º 5
0
 def runCollectOutput(self, args):
     """
 Run git with the given command line arguments and return a tuple with (returncode,output).
 """
     return subprocessExtras.callCollectOutput(["git"] + args,
                                               cwd=self.getPath())
Ejemplo n.º 6
0
 def getConfig(key):
   (returncode,stdout,stderr) = subprocessExtras.callCollectOutput([self.__gitExecutable,"config","--get",key])
   if returncode == 0:
     return stdout
   else:
     return None
Ejemplo n.º 7
0
 def runCollectOutput(self,args):
   """
   Run git with the given command line arguments and return a tuple with (returncode,output).
   """
   return subprocessExtras.callCollectOutput(["git"]+args,cwd=self.getPath())