annotate tag_repo.py @ 285:913fd8aa221c

Rename parentui to src (after mercurial rev 9b8ac5fb7760) Just pass in src to real_ui as a positional argument to avoid the problem in the future.
author Martijn Pieters <mj@zopatista.com>
date Mon, 27 Apr 2009 09:39:39 -0500
parents 91c818377703
children 33736e2e25f0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
124
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
1 from mercurial import node
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
2
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
3 import hg_delta_editor
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
4
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
5
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
6 def tags_from_tag_info(repo):
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
7 hg_editor = hg_delta_editor.HgChangeReceiver(repo=repo)
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
8 for tag, source in hg_editor.tags.iteritems():
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
9 source_ha = hg_editor.get_parent_revision(source[1]+1, source[0])
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
10 yield 'tag/%s'%tag, node.hex(source_ha)
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
11
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
12
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
13 def generate_repo_class(ui, repo):
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
14
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
15 class svntagrepo(repo.__class__):
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
16 def tags(self):
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
17 tags = dict((k, node.bin(v))
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
18 for k,v in tags_from_tag_info(self))
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
19 hg_tags = super(svntagrepo, self).tags()
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
20 tags.update(hg_tags)
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
21 return tags
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
22
291925677a9f tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
Luke Opperman <luke@loppear.com>
parents:
diff changeset
23 return svntagrepo