diff --git a/src/pmr2/wfctrl/cmd.py b/src/pmr2/wfctrl/cmd.py index 4cc657a..f8e9722 100644 --- a/src/pmr2/wfctrl/cmd.py +++ b/src/pmr2/wfctrl/cmd.py @@ -114,9 +114,11 @@ def pull(self, workspace, username=None, password=None, **kw): # XXX assuming repo is clean args = self._args(workspace, 'pull', target) output = self.execute(*args) - print("mercurial pull:") - print(output) - return output + return_code = 0 + if output[1]: + return_code = 1 + + return '\n'.join(output[0]).encode(), output[1], return_code def push(self, workspace, username=None, password=None, **kw): # XXX origin may be undefined @@ -124,8 +126,12 @@ def push(self, workspace, username=None, password=None, **kw): username=username, password=password) args = self._args(workspace, 'push', push_target) output = self.execute(*args) - print("mercurial push:") - print(output) + if len(output) == 2: + return_code = 0 + if output[1]: + return_code = 1 + return '\n'.join(output[0]).encode(), output[1], return_code + return output def reset_to_remote(self, workspace, branch=None):