Skip to content

Commit

Permalink
Sort out Mercurial push pull commands to operate like other DVCses.
Browse files Browse the repository at this point in the history
  • Loading branch information
hsorby committed Oct 16, 2023
1 parent 79425bb commit 03b51b1
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/pmr2/wfctrl/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,24 @@ 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
push_target = self.get_remote(workspace,
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):
Expand Down

0 comments on commit 03b51b1

Please sign in to comment.