comparison hglib/client.py @ 43:77ebb51f5f36

client: add tags command
author Idan Kamara <idankk86@gmail.com>
date Mon, 15 Aug 2011 22:46:45 +0300
parents b6b75c71ac58
children 3a661f63107e
comparison
equal deleted inserted replaced
42:b6b75c71ac58 43:77ebb51f5f36
621 args = cmdbuilder('tag', *names, r=rev, m=message, f=force, l=local, 621 args = cmdbuilder('tag', *names, r=rev, m=message, f=force, l=local,
622 remove=remove, d=date, u=user) 622 remove=remove, d=date, u=user)
623 623
624 self.rawcommand(args) 624 self.rawcommand(args)
625 625
626 def tags(self):
627 """
628 Return a list of repository tags as: (name, rev, node, islocal)
629 """
630 args = cmdbuilder('tags', v=True)
631
632 out = self.rawcommand(args)
633
634 t = []
635 for line in out.splitlines():
636 taglocal = line.endswith(' local')
637 if taglocal:
638 line = line[:-6]
639 name, rev = line.rsplit(' ', 1)
640 rev, node = rev.split(':')
641 t.append((name.rstrip(), int(rev), node, taglocal))
642 return t
643
626 def tip(self): 644 def tip(self):
627 args = cmdbuilder('tip', template=templates.changeset) 645 args = cmdbuilder('tip', template=templates.changeset)
628 out = self.rawcommand(args) 646 out = self.rawcommand(args)
629 out = out.split('\0') 647 out = out.split('\0')
630 648