comparison hglib/client.py @ 39:0555d58a7313

client: add push command
author Idan Kamara <idankk86@gmail.com>
date Mon, 15 Aug 2011 22:46:45 +0300
parents 32f6a2bbf63e
children 238efe4fd7db
comparison
equal deleted inserted replaced
38:32f6a2bbf63e 39:0555d58a7313
516 else: 516 else:
517 args = cmdbuilder('paths', name) 517 args = cmdbuilder('paths', name)
518 out = self.rawcommand(args) 518 out = self.rawcommand(args)
519 return out.rstrip() 519 return out.rstrip()
520 520
521 def push(self, dest=None, rev=None, force=False, bookmark=None, branch=None,
522 newbranch=False, ssh=None, remotecmd=None, insecure=False):
523 args = cmdbuilder('push', dest, r=rev, f=force, B=bookmark, b=branch,
524 new_branch=newbranch, e=ssh, remotecmd=remotecmd,
525 insecure=insecure)
526
527 # we could use Python 3 nonlocal here...
528 pushed = [True]
529
530 def eh(ret, out, err):
531 if ret == 1:
532 pushed[0] = False
533 else:
534 raise error.CommandError(args, ret, out, err)
535
536 self.rawcommand(args, eh=eh)
537 return pushed[0]
538
521 def remove(self, files, after=False, force=False, include=None, exclude=None): 539 def remove(self, files, after=False, force=False, include=None, exclude=None):
522 if not isinstance(files, list): 540 if not isinstance(files, list):
523 files = [files] 541 files = [files]
524 542
525 args = cmdbuilder('remove', *files, A=after, f=force, I=include, X=exclude) 543 args = cmdbuilder('remove', *files, A=after, f=force, I=include, X=exclude)