if self._u_any_in_string(strings, error) == True:
raise vcs.EmptyCommit()
else:
- raise vcs.CommandError(args, status, error)
+ raise vcs.CommandError(args, status, stdout="", stderr=error)
revision = None
revline = re.compile("Committed revision (.*)[.]")
match = revline.search(error)
if status == 128:
if error.startswith("fatal: ambiguous argument 'HEAD': unknown "):
return None
- raise vcs.CommandError(args, status, error)
+ raise vcs.CommandError(args, status, stdout="", stderr=error)
commits = output.splitlines()
try:
return commits[index]
class CommandError(Exception):
- def __init__(self, command, status, err_str):
- strerror = ["Command failed (%d):\n %s\n" % (status, err_str),
+ def __init__(self, command, status, stdout, stderr):
+ strerror = ["Command failed (%d):\n %s\n" % (status, stderr),
"while executing\n %s" % command]
Exception.__init__(self, "\n".join(strerror))
self.command = command
self.status = status
- self.err_str = err_str
+ self.stdout = stdout
+ self.stderr = stderr
class SettingIDnotSupported(NotImplementedError):
pass
q = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE,
shell=True, cwd=cwd)
except OSError, e :
- raise CommandError(args, e.args[0], e)
- output, error = q.communicate(input=stdin)
+ raise CommandError(args, status=e.args[0], stdout="", stderr=e)
+ output,error = q.communicate(input=stdin)
status = q.wait()
if self.verboseInvoke == True:
print >> sys.stderr, "%d\n%s%s" % (status, output, error)
if status not in expect:
- raise CommandError(args, status, error)
+ raise CommandError(args, status, output, error)
return status, output, error
def _u_invoke_client(self, *args, **kwargs):
directory = kwargs.get('directory',None)