comparison hgext/hgk.py @ 6958:e01ed40a31a2

i18n: mark strings for translation in hgk extension
author Martin Geisler <mg@daimi.au.dk>
date Sun, 31 Aug 2008 16:12:02 +0200
parents fdf5980bd010
children af694c6a888c
comparison
equal deleted inserted replaced
6957:bd979854a388 6958:e01ed40a31a2
45 vdiff on hovered and selected revisions.''' 45 vdiff on hovered and selected revisions.'''
46 46
47 import os 47 import os
48 from mercurial import commands, util, patch, revlog, cmdutil 48 from mercurial import commands, util, patch, revlog, cmdutil
49 from mercurial.node import nullid, nullrev, short 49 from mercurial.node import nullid, nullrev, short
50 from mercurial.i18n import _
50 51
51 def difftree(ui, repo, node1=None, node2=None, *files, **opts): 52 def difftree(ui, repo, node1=None, node2=None, *files, **opts):
52 """diff trees from two commits""" 53 """diff trees from two commits"""
53 def __difftree(repo, node1, node2, files=[]): 54 def __difftree(repo, node1, node2, files=[]):
54 assert node2 is not None 55 assert node2 is not None
147 except EOFError: 148 except EOFError:
148 return 149 return
149 150
150 else: 151 else:
151 if not type or not r: 152 if not type or not r:
152 ui.warn("cat-file: type or revision not supplied\n") 153 ui.warn(_("cat-file: type or revision not supplied\n"))
153 commands.help_(ui, 'cat-file') 154 commands.help_(ui, 'cat-file')
154 155
155 while r: 156 while r:
156 if type != "commit": 157 if type != "commit":
157 ui.warn("aborting hg cat-file only understands commits\n") 158 ui.warn(_("aborting hg cat-file only understands commits\n"))
158 return 1; 159 return 1;
159 n = repo.lookup(r) 160 n = repo.lookup(r)
160 catcommit(ui, repo, n, prefix) 161 catcommit(ui, repo, n, prefix)
161 if opts['stdin']: 162 if opts['stdin']:
162 try: 163 try:
314 def view(ui, repo, *etc, **opts): 315 def view(ui, repo, *etc, **opts):
315 "start interactive history viewer" 316 "start interactive history viewer"
316 os.chdir(repo.root) 317 os.chdir(repo.root)
317 optstr = ' '.join(['--%s %s' % (k, v) for k, v in opts.iteritems() if v]) 318 optstr = ' '.join(['--%s %s' % (k, v) for k, v in opts.iteritems() if v])
318 cmd = ui.config("hgk", "path", "hgk") + " %s %s" % (optstr, " ".join(etc)) 319 cmd = ui.config("hgk", "path", "hgk") + " %s %s" % (optstr, " ".join(etc))
319 ui.debug("running %s\n" % cmd) 320 ui.debug(_("running %s\n") % cmd)
320 util.system(cmd) 321 util.system(cmd)
321 322
322 cmdtable = { 323 cmdtable = {
323 "^view": 324 "^view":
324 (view, 325 (view,