comparison hglib/client.py @ 33:d74a5891d9d1

client: add missing options to status
author Idan Kamara <idankk86@gmail.com>
date Sun, 14 Aug 2011 00:49:56 +0300
parents a2fc0a7f648e
children f6e1d9a6e0cd
comparison
equal deleted inserted replaced
32:a2fc0a7f648e 33:d74a5891d9d1
514 return not warnings[0] 514 return not warnings[0]
515 515
516 def root(self): 516 def root(self):
517 return self.rawcommand(['root']).rstrip() 517 return self.rawcommand(['root']).rstrip()
518 518
519 def status(self): 519 def status(self, rev=None, change=None, all=False, modified=False, added=False,
520 out = self.rawcommand(['status', '-0']) 520 removed=False, deleted=False, clean=False, unknown=False,
521 521 ignored=False, copies=False, subrepos=False, include=None,
522 exclude=None):
523 """
524 Return a dictionary with the following keys:
525
526 M = modified
527 A = added
528 R = removed
529 C = clean
530 ! = missing (deleted by non-hg command, but still tracked)
531 ? = untracked
532 I = ignored
533 = origin of the previous file listed as A (added)
534
535 And a list of files to match as values.
536 """
537 if rev and change:
538 raise ValueError('cannot specify both rev and change')
539
540 args = cmdbuilder('status', rev=rev, change=change, A=all, m=modified,
541 a=added, r=removed, d=deleted, c=clean, u=unknown,
542 i=ignored, C=copies, S=subrepos, I=include, X=exclude)
543
544 args.append('-0')
545
546 out = self.rawcommand(args)
522 d = dict((c, []) for c in 'MARC!?I') 547 d = dict((c, []) for c in 'MARC!?I')
523 548
524 for entry in out.split('\0'): 549 for entry in out.split('\0'):
525 if entry: 550 if entry:
526 t, f = entry.split(' ', 1) 551 t, f = entry.split(' ', 1)