Mercurial > public > mercurial-scm > python-hglib
comparison hglib/client.py @ 31:ee8863882aae
client: add forget command
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Sun, 14 Aug 2011 00:49:15 +0300 |
parents | b7042bb3dbfd |
children | a2fc0a7f648e |
comparison
equal
deleted
inserted
replaced
30:b7042bb3dbfd | 31:ee8863882aae |
---|---|
320 raise error.CommandError(args, ret, out, err) | 320 raise error.CommandError(args, ret, out, err) |
321 | 321 |
322 self.rawcommand(args, eh=eh) | 322 self.rawcommand(args, eh=eh) |
323 return not warnings[0] | 323 return not warnings[0] |
324 | 324 |
325 def forget(self, files, include=None, exclude=None): | |
326 if not isinstance(files, list): | |
327 files = [files] | |
328 | |
329 args = cmdbuilder('forget', *files, I=include, X=exclude) | |
330 | |
331 # we could use Python 3 nonlocal here... | |
332 warnings = [False] | |
333 | |
334 def eh(ret, out, err): | |
335 if ret == 1: | |
336 warnings[0] = True | |
337 else: | |
338 raise error.CommandError(args, ret, out, err) | |
339 | |
340 out = self.rawcommand(args, eh=eh) | |
341 return not warnings[0] | |
342 | |
325 def import_(self, patches, strip=None, force=False, nocommit=False, | 343 def import_(self, patches, strip=None, force=False, nocommit=False, |
326 bypass=False, exact=False, importbranch=False, message=None, | 344 bypass=False, exact=False, importbranch=False, message=None, |
327 date=None, user=None, similarity=None): | 345 date=None, user=None, similarity=None): |
328 """ | 346 """ |
329 patches can be a list of file names with patches to apply | 347 patches can be a list of file names with patches to apply |