Mercurial > public > mercurial-scm > python-hglib
comparison hglib/client.py @ 52:18f72b255553
client: add annotate command
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Fri, 19 Aug 2011 19:46:11 +0300 |
parents | c52383a550fb |
children | 066dfa5c0b70 |
comparison
equal
deleted
inserted
replaced
51:c52383a550fb | 52:18f72b255553 |
---|---|
170 | 170 |
171 eh = util.reterrorhandler(args) | 171 eh = util.reterrorhandler(args) |
172 self.rawcommand(args, eh=eh) | 172 self.rawcommand(args, eh=eh) |
173 | 173 |
174 return bool(eh) | 174 return bool(eh) |
175 | |
176 def annotate(self, files, rev=None, nofollow=False, text=False, user=False, | |
177 file=False, date=False, number=False, changeset=False, | |
178 line=False, verbose=False, include=None, exclude=None): | |
179 """ | |
180 Show changeset information by line for each file in files. | |
181 | |
182 yields a (info, contents) tuple for each line in a file | |
183 """ | |
184 if not isinstance(files, list): | |
185 files = [files] | |
186 | |
187 args = cmdbuilder('annotate', *files, r=rev, no_follow=nofollow, a=text, | |
188 u=user, f=file, d=date, n=number, c=changeset, l=line, | |
189 v=verbose, I=include, X=exclude) | |
190 | |
191 out = self.rawcommand(args) | |
192 | |
193 for line in out.splitlines(): | |
194 yield tuple(line.split(': ', 1)) | |
175 | 195 |
176 def backout(self, rev, merge=False, parent=None, tool=None, message=None, | 196 def backout(self, rev, merge=False, parent=None, tool=None, message=None, |
177 logfile=None, date=None, user=None): | 197 logfile=None, date=None, user=None): |
178 if message and logfile: | 198 if message and logfile: |
179 raise ValueError("cannot specify both a message and a logfile") | 199 raise ValueError("cannot specify both a message and a logfile") |