comparison tag_repo.py @ 124:291925677a9f

tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
author Luke Opperman <luke@loppear.com>
date Thu, 04 Dec 2008 13:10:40 -0600
parents
children 91c818377703
comparison
equal deleted inserted replaced
123:58de7aea8a77 124:291925677a9f
1 import pickle
2
3 from mercurial import node
4
5 import hg_delta_editor
6
7
8 def tags_from_tag_info(repo):
9 hg_editor = hg_delta_editor.HgChangeReceiver(repo=repo)
10 for tag, source in hg_editor.tags.iteritems():
11 source_ha = hg_editor.get_parent_revision(source[1]+1, source[0])
12 yield 'tag/%s'%tag, node.hex(source_ha)
13
14
15 def generate_repo_class(ui, repo):
16
17 class svntagrepo(repo.__class__):
18 def tags(self):
19 tags = dict((k, node.bin(v))
20 for k,v in tags_from_tag_info(self))
21 hg_tags = super(svntagrepo, self).tags()
22 tags.update(hg_tags)
23 return tags
24
25 return svntagrepo