Mercurial > python-hglib
comparison hglib/client.py @ 32:a2fc0a7f648e
client: add move command
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Sun, 14 Aug 2011 00:49:28 +0300 |
parents | ee8863882aae |
children | d74a5891d9d1 |
comparison
equal
deleted
inserted
replaced
31:ee8863882aae | 32:a2fc0a7f648e |
---|---|
415 out = self.rawcommand(args) | 415 out = self.rawcommand(args) |
416 out = out.split('\0')[:-1] | 416 out = out.split('\0')[:-1] |
417 | 417 |
418 return self._parserevs(out) | 418 return self._parserevs(out) |
419 | 419 |
420 def move(self, source, dest, after=False, force=False, dryrun=False, | |
421 include=None, exclude=None): | |
422 if not isinstance(source, list): | |
423 source = [source] | |
424 | |
425 source.append(dest) | |
426 args = cmdbuilder('move', *source, A=after, f=force, n=dryrun, | |
427 I=include, X=exclude) | |
428 | |
429 # we could use Python 3 nonlocal here... | |
430 warnings = [False] | |
431 | |
432 def eh(ret, out, err): | |
433 if ret == 1: | |
434 warnings[0] = True | |
435 else: | |
436 raise error.CommandError(args, ret, out, err) | |
437 | |
438 self.rawcommand(args, eh=eh) | |
439 return not warnings[0] | |
440 | |
420 def outgoing(self, revrange=None, path=None, force=False, newest=False, | 441 def outgoing(self, revrange=None, path=None, force=False, newest=False, |
421 bookmarks=False, branch=None, limit=None, nomerges=False, | 442 bookmarks=False, branch=None, limit=None, nomerges=False, |
422 subrepos=False): | 443 subrepos=False): |
423 """ | 444 """ |
424 Return changesets not found in the specified path or the default push | 445 Return changesets not found in the specified path or the default push |