comparison svncommand.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 ed42f6e5705a
children ba801f44d240
comparison
equal deleted inserted replaced
123:58de7aea8a77 124:291925677a9f
1 import os 1 import os
2 import pickle
3 import stat 2 import stat
4 import sys 3 import sys
5 import traceback 4 import traceback
6 5
7 from mercurial import hg 6 from mercurial import hg
8 from mercurial import node 7 from mercurial import node
9 from mercurial import util as merc_util 8 from mercurial import util as merc_util
10 9
11 import svnwrap 10 import svnwrap
12 import hg_delta_editor
13 import util 11 import util
14 from util import register_subcommand, svn_subcommands, generate_help 12 from util import register_subcommand, svn_subcommands, generate_help
15 # dirty trick to force demandimport to run my decorator anyway. 13 # dirty trick to force demandimport to run my decorator anyway.
16 from utility_commands import print_wc_url 14 from utility_commands import print_wc_url
17 from fetch_command import fetch_revisions 15 from fetch_command import fetch_revisions
75 if doc is None: 73 if doc is None:
76 doc = "No documentation available for %s." % subcommand 74 doc = "No documentation available for %s." % subcommand
77 ui.status(doc.strip(), '\n') 75 ui.status(doc.strip(), '\n')
78 return 76 return
79 ui.status(generate_help()) 77 ui.status(generate_help())
80
81
82 @register_subcommand('gentags')
83 def generate_hg_tags(ui, hg_repo_path, **opts):
84 """Save tags to .hg/localtags
85 """
86 hg_editor = hg_delta_editor.HgChangeReceiver(hg_repo_path, ui_=ui)
87 f = open(hg_editor.tag_info_file)
88 tag_info = pickle.load(f)
89 f = open(os.path.join(hg_repo_path, '.hg', 'localtags'), 'w')
90 for tag, source in tag_info.iteritems():
91 source_ha = hg_editor.get_parent_revision(source[1]+1, source[0])
92 f.write('%s tag/%s\n' % (node.hex(source_ha), tag))
93 78
94 @register_subcommand('up') 79 @register_subcommand('up')
95 def update(ui, args, repo, clean=False, **opts): 80 def update(ui, args, repo, clean=False, **opts):
96 """Update to a specified Subversion revision number. 81 """Update to a specified Subversion revision number.
97 """ 82 """