Mercurial > python-hglib
comparison hglib/client.py @ 63:939d1d763bb1
client: add resolve command
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Fri, 19 Aug 2011 22:52:59 +0300 |
parents | d1f57f162274 |
children | a7d98dc798c5 |
comparison
equal
deleted
inserted
replaced
62:d1f57f162274 | 63:939d1d763bb1 |
---|---|
675 | 675 |
676 eh = util.reterrorhandler(args) | 676 eh = util.reterrorhandler(args) |
677 self.rawcommand(args, eh=eh) | 677 self.rawcommand(args, eh=eh) |
678 | 678 |
679 return bool(eh) | 679 return bool(eh) |
680 | |
681 def resolve(self, file=[], all=False, listfiles=False, mark=False, unmark=False, | |
682 tool=None, include=None, exclude=None): | |
683 """ | |
684 redo merges or set/view the merge status of files | |
685 | |
686 When listfiles is True, returns a list of (code, file path) of resolved | |
687 and unresolved files. Code will be 'R' or 'U' accordingly. | |
688 """ | |
689 if not isinstance(file, list): | |
690 file = [file] | |
691 | |
692 args = cmdbuilder('resolve', *file, a=all, l=listfiles, m=mark, u=unmark, | |
693 t=tool, I=include, X=exclude) | |
694 | |
695 out = self.rawcommand(args) | |
696 | |
697 if listfiles: | |
698 l = [] | |
699 for line in out.splitlines(): | |
700 l.append(tuple(line.split(' ', 1))) | |
701 return l | |
680 | 702 |
681 def revert(self, files, rev=None, all=False, date=None, nobackup=False, | 703 def revert(self, files, rev=None, all=False, date=None, nobackup=False, |
682 dryrun=False, include=None, exclude=None): | 704 dryrun=False, include=None, exclude=None): |
683 if not isinstance(files, list): | 705 if not isinstance(files, list): |
684 files = [files] | 706 files = [files] |