comparison hglib/client.py @ 40:238efe4fd7db

client: add pull command
author Idan Kamara <idankk86@gmail.com>
date Mon, 15 Aug 2011 22:46:45 +0300
parents 0555d58a7313
children e185c3922c68
comparison
equal deleted inserted replaced
39:0555d58a7313 40:238efe4fd7db
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 pull(self, source=None, rev=None, update=False, force=False, bookmark=None,
522 branch=None, ssh=None, remotecmd=None, insecure=False, tool=None):
523 args = cmdbuilder('pull', source, r=rev, u=update, f=force, B=bookmark,
524 b=branch, e=ssh, remotecmd=remotecmd, insecure=insecure,
525 t=tool)
526
527 # we could use Python 3 nonlocal here...
528 success = [True]
529
530 def eh(ret, out, err):
531 if ret == 1:
532 success[0] = False
533 else:
534 raise error.CommandError(args, ret, out, err)
535
536 self.rawcommand(args, eh=eh)
537 return success[0]
538
521 def push(self, dest=None, rev=None, force=False, bookmark=None, branch=None, 539 def push(self, dest=None, rev=None, force=False, bookmark=None, branch=None,
522 newbranch=False, ssh=None, remotecmd=None, insecure=False): 540 newbranch=False, ssh=None, remotecmd=None, insecure=False):
523 args = cmdbuilder('push', dest, r=rev, f=force, B=bookmark, b=branch, 541 args = cmdbuilder('push', dest, r=rev, f=force, B=bookmark, b=branch,
524 new_branch=newbranch, e=ssh, remotecmd=remotecmd, 542 new_branch=newbranch, e=ssh, remotecmd=remotecmd,
525 insecure=insecure) 543 insecure=insecure)