Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

hggtk: translatable strings, round 2

Changeset 73d01df955ba

Parent efd65cbaed9c

by Steve Borho

Changes to 9 files · Browse files at 73d01df955ba Showing diff from parent efd65cbaed9c Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​gdialog.py Stacked
 
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
 
 
 
 
 
 
26
27
28
 
32
33
34
35
36
37
38
 
335
336
337
338
 
339
340
341
 
6
7
8
 
 
 
 
 
 
 
 
 
 
 
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
28
29
30
 
31
32
33
 
330
331
332
 
333
334
335
336
@@ -6,23 +6,19 @@
 # of the GNU General Public License, incorporated herein by reference.  #   -import mercurial.demandimport; mercurial.demandimport.disable() - -import os -import threading -import StringIO -import sys -import shutil -import tempfile -import datetime -import cPickle -  import pygtk  pygtk.require('2.0')  import gtk  import gobject  import pango   +import os +import threading +import cStringIO +import sys +import shutil +import tempfile +  from mercurial.i18n import _  from mercurial.node import short  from mercurial import cmdutil, util, ui, hg, commands @@ -32,7 +28,6 @@
 from gtklib import MessageDialog  from hglib import toutf   -  class SimpleMessage(MessageDialog):   def run(self):   response = MessageDialog.run(self) @@ -335,7 +330,7 @@
  """   textout = ''   saved = sys.stderr - errors = StringIO.StringIO() + errors = cStringIO.StringIO()   try:   sys.stderr = errors   self.ui.pushbuffer()
Change 1 of 6 Show Entire File hggtk/​hgcmd.py Stacked
 
6
7
8
9
10
11
12
 
15
16
17
 
18
19
20
 
33
34
35
36
 
37
38
39
40
 
41
42
43
 
74
75
76
77
 
78
79
80
 
86
87
88
89
 
90
91
92
 
133
134
135
136
 
137
138
139
 
6
7
8
 
9
10
11
 
14
15
16
17
18
19
20
 
33
34
35
 
36
37
38
39
 
40
41
42
43
 
74
75
76
 
77
78
79
80
 
86
87
88
 
89
90
91
92
 
133
134
135
 
136
137
138
139
@@ -6,7 +6,6 @@
   import pygtk  pygtk.require("2.0") -  import gtk  import gobject  import pango @@ -15,6 +14,7 @@
 import Queue  from hglib import HgThread, hgcmd_toq, toutf  from shlib import set_tortoise_icon, get_system_times +from mercurial.i18n import _    class CmdDialog(gtk.Dialog):   def __init__(self, cmdline, progressbar=True, width=520, height=400): @@ -33,11 +33,11 @@
  # construct dialog   self.set_default_size(width, height)   - self._button_stop = gtk.Button("Stop") + self._button_stop = gtk.Button(_('Stop'))   self._button_stop.connect('clicked', self._on_stop_clicked)   self.action_area.pack_start(self._button_stop)   - self._button_ok = gtk.Button("Close") + self._button_ok = gtk.Button(_('Close'))   self._button_ok.connect('clicked', self._on_ok_clicked)   self.action_area.pack_start(self._button_ok)   @@ -74,7 +74,7 @@
  scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)   self.textview = gtk.TextView(buffer=None)   self.textview.set_editable(False) - self.textview.modify_font(pango.FontDescription("Monospace")) + self.textview.modify_font(pango.FontDescription('Monospace'))   scrolledwindow.add(self.textview)   self.textbuffer = self.textview.get_buffer()   @@ -86,7 +86,7 @@
  def _on_ok_clicked(self, button):   """ Ok button clicked handler. """   self.response(gtk.RESPONSE_ACCEPT) - +   def _on_stop_clicked(self, button):   if self.hgthread:   self.hgthread.terminate() @@ -133,7 +133,7 @@
  self._button_ok.grab_focus()   self.returncode = self.hgthread.return_code()   if self.returncode is None: - self.write("\n[command interrupted]") + self.write(_('\n[command interrupted]'))   return False # Stop polling this function   else:   return True
Change 1 of 11 Show Entire File hggtk/​hgemail.py Stacked
 
13
14
15
 
16
17
18
 
31
32
33
34
 
35
36
 
37
38
 
39
40
 
41
42
43
 
47
48
49
50
 
51
52
 
53
54
 
55
56
57
58
59
 
 
60
61
62
 
68
69
70
71
72
 
 
73
74
75
 
79
80
81
82
83
 
 
84
85
86
 
90
91
92
93
94
 
 
95
96
97
 
101
102
103
104
 
105
106
107
 
108
109
 
110
111
112
 
113
114
115
 
116
117
 
118
119
120
 
121
122
123
 
124
125
 
126
127
128
 
129
130
131
 
132
133
 
134
135
136
137
138
139
 
140
141
142
143
144
145
 
146
147
148
149
150
151
 
152
153
154
 
156
157
158
159
 
160
161
162
163
 
164
165
166
 
243
244
245
246
 
 
247
248
249
250
 
 
251
252
253
 
255
256
257
258
 
 
259
260
261
 
301
302
303
304
305
 
306
307
308
 
13
14
15
16
17
18
19
 
32
33
34
 
35
36
 
37
38
 
39
40
 
41
42
43
44
 
48
49
50
 
51
52
 
53
54
 
55
56
57
58
 
 
59
60
61
62
63
 
69
70
71
 
 
72
73
74
75
76
 
80
81
82
 
 
83
84
85
86
87
 
91
92
93
 
 
94
95
96
97
98
 
102
103
104
 
105
106
107
 
108
109
 
110
111
112
 
113
114
115
 
116
117
 
118
119
120
 
121
122
123
 
124
125
 
126
127
128
 
129
130
131
 
132
133
 
134
135
136
137
138
139
 
140
141
142
143
144
145
 
146
147
148
149
150
151
 
152
153
154
155
 
157
158
159
 
160
161
162
163
 
164
165
166
167
 
244
245
246
 
247
248
249
250
251
 
252
253
254
255
256
 
258
259
260
 
261
262
263
264
265
 
305
306
307
 
 
308
309
310
311
@@ -13,6 +13,7 @@
 from tempfile import mkstemp  from dialog import *  from mercurial import hg, ui, extensions +from mercurial.i18n import _  from hglib import RepoError, fromutf, toutf  from thgconfig import ConfigDialog  from hgcmd import CmdDialog @@ -31,13 +32,13 @@
  self.tips = gtk.Tooltips()     tbuttons = [ - self._toolbutton(gtk.STOCK_GOTO_LAST, 'Send', + self._toolbutton(gtk.STOCK_GOTO_LAST, _('send'),   self._on_send_clicked, - 'Send email(s)'), + _('Send email(s)')),   gtk.SeparatorToolItem(), - self._toolbutton(gtk.STOCK_PREFERENCES, 'configure', + self._toolbutton(gtk.STOCK_PREFERENCES, _('configure'),   self._on_conf_clicked, - 'Configure email settings') + _('Configure email settings'))   ]   for btn in tbuttons:   self.tbar.insert(btn, -1) @@ -47,16 +48,16 @@
    # set dialog title   if revargs[0] in ('--outgoing', '-o'): - self.set_title('Email outgoing changes') + self.set_title(_('Email outgoing changes'))   elif revargs[0] in ('--rev', '-r'): - self.set_title('Email revision(s) ' + ' '.join(revargs[1:])) + self.set_title(_('Email revision(s) ') + ' '.join(revargs[1:]))   else: - self.set_title('Email Mercurial Patches') + self.set_title(_('Email Mercurial Patches'))   self.set_default_size(630, 400)     hbox = gtk.HBox() - envframe = gtk.Frame('Envelope') - flagframe = gtk.Frame('Options') + envframe = gtk.Frame(_('Envelope')) + flagframe = gtk.Frame(_('Options'))   hbox.pack_start(envframe, True, True, 4)   hbox.pack_start(flagframe, False, False, 4)   mainvbox.pack_start(hbox, False, True, 4) @@ -68,8 +69,8 @@
  hbox = gtk.HBox()   self._tolist = gtk.ListStore(str)   self._tobox = gtk.ComboBoxEntry(self._tolist, 0) - lbl = gtk.Label('To:') - lbl.set_property("width-chars", 5) + lbl = gtk.Label(_('To:')) + lbl.set_property('width-chars', 5)   lbl.set_alignment(1.0, 0.5)   hbox.pack_start(lbl, False, False, 4)   hbox.pack_start(self._tobox, True, True, 4) @@ -79,8 +80,8 @@
  hbox = gtk.HBox()   self._cclist = gtk.ListStore(str)   self._ccbox = gtk.ComboBoxEntry(self._cclist, 0) - lbl = gtk.Label('Cc:') - lbl.set_property("width-chars", 5) + lbl = gtk.Label(_('Cc:')) + lbl.set_property('width-chars', 5)   lbl.set_alignment(1.0, 0.5)   hbox.pack_start(lbl, False, False, 4)   hbox.pack_start(self._ccbox, True, True, 4) @@ -90,8 +91,8 @@
  hbox = gtk.HBox()   self._fromlist = gtk.ListStore(str)   self._frombox = gtk.ComboBoxEntry(self._fromlist, 0) - lbl = gtk.Label('From:') - lbl.set_property("width-chars", 5) + lbl = gtk.Label(_('From:')) + lbl.set_property('width-chars', 5)   lbl.set_alignment(1.0, 0.5)   hbox.pack_start(lbl, False, False, 4)   hbox.pack_start(self._frombox, True, True, 4) @@ -101,54 +102,54 @@
  flagframe.add(vbox)     self.tooltips = gtk.Tooltips() - self._normal = gtk.RadioButton(None, "Send changesets as HG patches") + self._normal = gtk.RadioButton(None, _('Send changesets as HG patches'))   vbox.pack_start(self._normal, True, True, 4)   self.tooltips.set_tip(self._normal, - 'HG patches (as generated by export command) are compatible' + _('HG patches (as generated by export command) are compatible'   ' with most patch programs. They include a header which' - ' contains the most important changeset metadata.') + ' contains the most important changeset metadata.'))     self._git = gtk.RadioButton(self._normal, - "Use extended (git) patch format") + _('Use extended (git) patch format'))   vbox.pack_start(self._git, True, True, 4)   self.tooltips.set_tip(self._git, - 'Git patches can describe binary files, copies, and' + _('Git patches can describe binary files, copies, and'   ' permission changes, but recipients may not be able to' - ' use them if they are not using git or Mercurial.') + ' use them if they are not using git or Mercurial.'))     self._plain = gtk.RadioButton(self._normal, - "Plain, do not prepend HG header") + _('Plain, do not prepend HG header'))   vbox.pack_start(self._plain, True, True, 4)   self.tooltips.set_tip(self._plain, - 'Stripping Mercurial header removes username and parent' + _('Stripping Mercurial header removes username and parent'   ' information. Only useful if recipient is not using' - ' Mercurial (and does not like to see the headers).') + ' Mercurial (and does not like to see the headers).'))     self._bundle = gtk.RadioButton(self._normal, - "Send single binary bundle, not patches") + _('Send single binary bundle, not patches'))   vbox.pack_start(self._bundle, True, True, 4)   self.tooltips.set_tip(self._bundle, - 'Bundles store complete changesets in binary form.' + _('Bundles store complete changesets in binary form.'   ' Upstream users can pull from them. This is the safest' - ' way to send changes to recipient Mercurial users.') + ' way to send changes to recipient Mercurial users.'))     vbox = gtk.VBox()   hbox = gtk.HBox()   self._subjlist = gtk.ListStore(str)   self._subjbox = gtk.ComboBoxEntry(self._subjlist, 0) - hbox.pack_start(gtk.Label('Subject:'), False, False, 4) + hbox.pack_start(gtk.Label(_('Subject:')), False, False, 4)   hbox.pack_start(self._subjbox, True, True, 4)   vbox.pack_start(hbox, False, False, 4)     self.descview = gtk.TextView(buffer=None)   self.descview.set_editable(True) - self.descview.modify_font(pango.FontDescription("Monospace")) + self.descview.modify_font(pango.FontDescription('Monospace'))   self.descbuffer = self.descview.get_buffer()   scrolledwindow = gtk.ScrolledWindow()   scrolledwindow.set_shadow_type(gtk.SHADOW_ETCHED_IN)   scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)   scrolledwindow.add(self.descview) - frame = gtk.Frame('Patch Series (Bundle) Description') + frame = gtk.Frame(_('Patch Series (Bundle) Description'))   frame.set_border_width(4)   vbox.pack_start(scrolledwindow, True, True, 4)   vbox.set_border_width(4) @@ -156,11 +157,11 @@
  eventbox.add(vbox)   frame.add(eventbox)   self.tooltips.set_tip(eventbox, - 'Patch series description is sent in initial summary' + _('Patch series description is sent in initial summary'   ' email with [PATCH 0 of N] subject. It should describe'   ' the effects of the entire patch series. When emailing'   ' a bundle, these fields make up the message subject and body.' - ' The description field is unused when sending a single patch') + ' The description field is unused when sending a single patch'))   mainvbox.pack_start(frame, True, True, 4)     self.connect('map_event', self._on_window_map_event) @@ -243,11 +244,13 @@
  subjtext = fromutf(self._subjbox.child.get_text())     if not totext: - info_dialog(self, 'Info required', 'You must specify a recipient') + info_dialog(self, _('Info required'), + _('You must specify a recipient'))   self._tobox.grab_focus()   return   if not fromtext: - info_dialog(self, 'Info required', 'You must specify a sender address') + info_dialog(self, _('Info required'), + _('You must specify a sender address'))   self._frombox.grab_focus()   return   if not self.repo: @@ -255,7 +258,8 @@
    if self.repo.ui.config('email', 'method', 'smtp') == 'smtp':   if not self.repo.ui.config('smtp', 'host'): - info_dialog(self, 'Info required', 'You must configure SMTP') + info_dialog(self, _('Info required'), + _('You must configure SMTP'))   dlg = ConfigDialog(self.root, False)   dlg.show_all()   dlg.focus_field('smtp.host') @@ -301,8 +305,7 @@
 def run(root='', **opts):   # In most use cases, this dialog will be launched by other   # hggtk tools like glog and synch. It's not expected to be - # used from hgproc or the command line. I leave this path in - # place for testing purposes. + # used from hgtk. I leave this path in place for testing purposes.   dialog = EmailDialog(root, ['tip'])   dialog.show_all()   dialog.connect('destroy', gtk.main_quit)
Change 1 of 5 Show Entire File hggtk/​hgignore.py Stacked
 
10
11
12
 
13
14
15
 
19
20
21
22
 
23
24
25
26
27
28
29
30
 
 
31
32
33
34
35
 
36
37
38
 
41
42
43
44
45
 
 
46
47
48
49
50
 
51
52
53
54
55
56
57
 
58
59
60
61
62
63
 
64
65
66
 
71
72
73
74
75
 
 
76
77
78
79
80
81
 
82
83
84
 
85
86
87
 
94
95
96
97
98
 
 
99
100
101
 
10
11
12
13
14
15
16
 
20
21
22
 
23
24
25
26
27
28
29
 
 
30
31
32
33
34
35
 
36
37
38
39
 
42
43
44
 
 
45
46
47
48
49
50
 
51
52
53
54
55
56
57
 
58
59
60
61
62
63
 
64
65
66
67
 
72
73
74
 
 
75
76
77
78
79
80
81
 
82
83
84
 
85
86
87
88
 
95
96
97
 
 
98
99
100
101
102
@@ -10,6 +10,7 @@
 from shlib import shell_notify, set_tortoise_icon  from hglib import fromutf, toutf  from mercurial import hg, ui, match +from mercurial.i18n import _    class HgIgnoreDialog(gtk.Window):   'Edit a reposiory .hgignore file' @@ -19,20 +20,20 @@
  set_tortoise_icon(self, 'ignore.ico')     self.root = root - self.set_title('Ignore filter for ' + os.path.basename(root)) + self.set_title(_('Ignore filter for ') + os.path.basename(root))   self.set_default_size(630, 400)   self.notify_func = None     mainvbox = gtk.VBox()     hbox = gtk.HBox() - lbl = gtk.Label('Glob:') - lbl.set_property("width-chars", 7) + lbl = gtk.Label(_('Glob:')) + lbl.set_property('width-chars', 7)   lbl.set_alignment(1.0, 0.5)   hbox.pack_start(lbl, False, False, 4)   glob_entry = gtk.Entry()   hbox.pack_start(glob_entry, True, True, 4) - glob_button = gtk.Button('add') + glob_button = gtk.Button(_('add'))   hbox.pack_start(glob_button, False, False, 4)   glob_button.connect('clicked', self.add_glob, glob_entry)   glob_entry.connect('activate', self.add_glob, glob_entry) @@ -41,26 +42,26 @@
  mainvbox.pack_start(hbox, False, False)     hbox = gtk.HBox() - lbl = gtk.Label('Regexp:') - lbl.set_property("width-chars", 7) + lbl = gtk.Label(_('Regexp:')) + lbl.set_property('width-chars', 7)   lbl.set_alignment(1.0, 0.5)   hbox.pack_start(lbl, False, False, 4)   regexp_entry = gtk.Entry()   hbox.pack_start(regexp_entry, True, True, 4) - regexp_button = gtk.Button('add') + regexp_button = gtk.Button(_('add'))   hbox.pack_start(regexp_button, False, False, 4)   regexp_button.connect('clicked', self.add_regexp, regexp_entry)   regexp_entry.connect('activate', self.add_regexp, regexp_entry)   mainvbox.pack_start(hbox, False, False)     hbox = gtk.HBox() - frame = gtk.Frame('Filters') + frame = gtk.Frame(_('Filters'))   hbox.pack_start(frame, True, True, 4)   pattree = gtk.TreeView()   pattree.set_reorderable(False)   sel = pattree.get_selection()   sel.set_mode(gtk.SELECTION_SINGLE) - col = gtk.TreeViewColumn('Patterns', gtk.CellRendererText(), text=0) + col = gtk.TreeViewColumn(_('Patterns'), gtk.CellRendererText(), text=0)   pattree.append_column(col)   pattree.set_headers_visible(False)   self.pattree = pattree @@ -71,17 +72,17 @@
  vbox = gtk.VBox()   vbox.pack_start(scrolledwindow, True, True, 2)   bhbox = gtk.HBox() - remove = gtk.Button("Remove Selected") - remove.connect("pressed", self.remove_pressed, sel) + remove = gtk.Button(_('Remove Selected')) + remove.connect('pressed', self.remove_pressed, sel)   remove.set_sensitive(False)   bhbox.pack_start(remove, False, False, 2)   vbox.pack_start(bhbox, False, False, 2)   frame.add(vbox)   - frame = gtk.Frame('Unknown Files') + frame = gtk.Frame(_('Unknown Files'))   hbox.pack_start(frame, True, True, 4)   unknowntree = gtk.TreeView() - col = gtk.TreeViewColumn('Files', gtk.CellRendererText(), text=0) + col = gtk.TreeViewColumn(_('Files'), gtk.CellRendererText(), text=0)   unknowntree.append_column(col)   scrolledwindow = gtk.ScrolledWindow()   scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) @@ -94,8 +95,8 @@
  vbox = gtk.VBox()   vbox.pack_start(scrolledwindow, True, True, 2)   bhbox = gtk.HBox() - refresh = gtk.Button("Refresh") - refresh.connect("pressed", self.refresh_clicked, sel) + refresh = gtk.Button(_('Refresh')) + refresh.connect('pressed', self.refresh_clicked, sel)   bhbox.pack_start(refresh, False, False, 2)   vbox.pack_start(bhbox, False, False, 2)   frame.add(vbox)
Change 1 of 9 Show Entire File hggtk/​hginit.py Stacked
 
10
11
12
 
13
14
15
 
21
22
23
24
 
25
26
27
 
41
42
43
44
 
45
46
 
47
48
49
 
53
54
55
56
57
 
 
58
59
60
 
62
63
64
65
66
 
 
67
68
69
 
79
80
81
82
 
83
84
 
85
86
87
 
131
132
133
134
135
 
 
136
137
138
 
146
147
148
149
150
 
151
152
153
154
 
155
156
157
158
 
159
160
161
 
170
171
172
173
174
 
 
175
176
177
 
10
11
12
13
14
15
16
 
22
23
24
 
25
26
27
28
 
42
43
44
 
45
46
 
47
48
49
50
 
54
55
56
 
 
57
58
59
60
61
 
63
64
65
 
 
66
67
68
69
70
 
80
81
82
 
83
84
 
85
86
87
88
 
132
133
134
 
 
135
136
137
138
139
 
147
148
149
 
 
150
151
152
 
 
153
154
155
156
 
157
158
159
160
 
169
170
171
 
 
172
173
174
175
176
@@ -10,6 +10,7 @@
 import gtk  from dialog import error_dialog, info_dialog  from mercurial import hg, ui, util +from mercurial.i18n import _  from hglib import toutf, fromutf, RepoError  import shlib   @@ -21,7 +22,7 @@
    # set dialog title and icon   self.cwd = cwd and cwd or os.getcwd() - title = 'Hg init - %s' % toutf(self.cwd) + title = 'hg init - %s' % toutf(self.cwd)   self.set_title(title)   shlib.set_tortoise_icon(self, 'menucreaterepos.ico')   @@ -41,9 +42,9 @@
    self._btn_init = self._toolbutton(   gtk.STOCK_NEW, - 'Create', + _('Create'),   self._btn_init_clicked, - tip='Create a new repository in destination directory') + tip=_('Create a new repository in destination directory'))   tbuttons = [   self._btn_init,   ] @@ -53,8 +54,8 @@
  sep.set_expand(True)   sep.set_draw(False)   self.tbar.insert(sep, -1) - button = self._toolbutton(gtk.STOCK_CLOSE, 'Close', - self._close_clicked, tip='Close Application') + button = self._toolbutton(gtk.STOCK_CLOSE, _('Close'), + self._close_clicked, tip=_('Close Application'))   self.tbar.insert(button, -1)   vbox = gtk.VBox()   self.add(vbox) @@ -62,8 +63,8 @@
    # clone source   srcbox = gtk.HBox() - lbl = gtk.Label(" Destination :") - lbl.set_property("width-chars", 12) + lbl = gtk.Label(_(' Destination :')) + lbl.set_property('width-chars', 12)   lbl.set_alignment(0, 0.5)   self._dest_input = gtk.Entry()   self._dest_input.set_text(toutf(self._dest_path)) @@ -79,9 +80,9 @@
  # options   option_box = gtk.VBox()   self._opt_specialfiles = gtk.CheckButton( - "Add special files (.hgignore, ...)") + _('Add special files (.hgignore, ...)'))   self._opt_oldrepoformat = gtk.CheckButton( - "Make repo compatible with Mercurial 1.0") + _('Make repo compatible with Mercurial 1.0'))   option_box.pack_start(self._opt_specialfiles, False, False)   option_box.pack_start(self._opt_oldrepoformat, False, False)   vbox.pack_start(option_box, False, False, 15) @@ -131,8 +132,8 @@
    # verify input   if dest == "": - error_dialog(self, "Destination path is empty", - "Please enter the directory path") + error_dialog(self, _('Destination path is empty'), + _('Please enter the directory path'))   self._dest_input.grab_focus()   return False   @@ -146,16 +147,14 @@
  try:   hg.repository(u, dest, create=1)   except RepoError, inst: - error_dialog(self, "Unable to create new repository", - str(inst)) + error_dialog(self, _('Unable to create new repository'), str(inst))   return False   except util.Abort, inst: - error_dialog(self, "Error when creating repository", - str(inst)) + error_dialog(self, _('Error when creating repository'), str(inst))   return False   except:   import traceback - error_dialog(self, "Error when creating repository", + error_dialog(self, _('Error when creating repository'),   traceback.format_exc())   return False   @@ -170,8 +169,8 @@
  except:   pass   - info_dialog(self, "New repository created", - "in directory %s" % toutf(os.path.abspath(dest))) + info_dialog(self, _('New repository created in directory %s') % + toutf(os.path.abspath(dest)))    def run(cwd='', files=[], **opts):   dialog = InitDialog(cwd, repos=files)
Change 1 of 5 Show Entire File hggtk/​hglib.py Stacked
 
150
151
152
153
 
154
155
156
 
224
225
226
227
 
228
229
 
230
231
232
 
320
321
322
323
324
 
 
325
326
327
 
358
359
360
361
362
 
 
363
364
365
 
378
379
380
381
 
382
383
384
 
150
151
152
 
153
154
155
156
 
224
225
226
 
227
228
 
229
230
231
232
 
320
321
322
 
 
323
324
325
326
327
 
358
359
360
 
 
361
362
363
364
365
 
378
379
380
 
381
382
383
384
@@ -150,7 +150,7 @@
  if not pat or re.match(pat, r):   return r   else: - self.write(_("unrecognized response\n")) + self.write(_('unrecognized response\n'))   except EOFError:   raise util.Abort(_('response expected'))   @@ -224,9 +224,9 @@
  if origui:   ui.ui = origui   if ret: - self.ui.write('[command returned code %d]\n' % int(ret)) + self.ui.write(_('[command returned code %d]\n') % int(ret))   else: - self.ui.write('[command completed successfully]\n') + self.ui.write(_('[command completed successfully]\n'))   self.ret = ret or 0   if self.postfunc:   self.postfunc(ret) @@ -320,8 +320,8 @@
  cmdtable = getattr(module, 'cmdtable', {})   overrides = [cmd for cmd in cmdtable if cmd in commands.table]   if overrides: - ui.warn(_("extension '%s' overrides commands: %s\n") - % (name, " ".join(overrides))) + ui.warn(_("extension '%s' overrides commands: %s\n") % + (name, " ".join(overrides)))   commands.table.update(cmdtable)   _loaded[name] = 1   @@ -358,8 +358,8 @@
  except RepoError:   if cmd not in commands.optionalrepo.split():   if not path: - raise RepoError(_("There is no Mercurial repository here" - " (.hg not found)")) + raise RepoError(_('There is no Mercurial repository here' + ' (.hg not found)'))   raise   d = lambda: func(ui, repo, *args, **cmdoptions)   else: @@ -378,7 +378,7 @@
  tb = traceback.extract_tb(sys.exc_info()[2])   if len(tb) != 2: # no   raise - raise ParseError(cmd, _("invalid arguments")) + raise ParseError(cmd, _('invalid arguments'))     # run post-hook, passing command result   hook.hook(ui, repo, "post-%s" % cmd, False, args=" ".join(fullargs),
Change 1 of 8 Show Entire File hggtk/​hgshelve.py Stacked
 
80
81
82
83
 
84
85
86
 
282
283
284
285
 
286
287
288
 
388
389
390
391
 
392
393
394
 
489
490
491
492
 
493
494
495
496
497
498
499
 
500
501
502
 
507
508
509
510
 
511
512
 
513
514
515
 
518
519
520
521
 
522
523
524
 
543
544
545
546
 
547
548
549
 
556
557
558
559
 
560
561
 
562
563
564
565
566
 
567
568
569
570
571
572
 
573
574
 
575
576
 
577
578
579
 
80
81
82
 
83
84
85
86
 
282
283
284
 
285
286
287
288
 
388
389
390
 
391
392
393
394
 
489
490
491
 
492
493
494
495
496
497
498
 
499
500
501
502
 
507
508
509
 
510
511
 
512
513
514
515
 
518
519
520
 
521
522
523
524
 
543
544
545
 
546
547
548
549
 
556
557
558
 
559
560
 
561
562
563
564
565
 
566
567
568
569
570
571
 
572
573
 
574
575
 
576
577
578
579
@@ -80,7 +80,7 @@
  if m:   yield 'range', m.groups()   else: - raise patch.PatchError('unknown patch content: %r' % line) + raise patch.PatchError(_('unknown patch content: %r') % line)    class header(object):   diff_re = re.compile('diff --git a/(.*) b/(.*)$') @@ -282,7 +282,7 @@
  try:   p.transitions[state][newstate](p, data)   except KeyError: - raise patch.PatchError('unhandled transition: %s -> %s' % + raise patch.PatchError(_('unhandled transition: %s -> %s') %   (state, newstate))   state = newstate   return p.finished() @@ -388,7 +388,7 @@
  fd, tmpname = tempfile.mkstemp(prefix=f.replace('/', '_')+'.',   dir=dir)   os.close(fd) - ui.debug('backup %r as %r\n' % (f, tmpname)) + ui.debug(_('backup %r as %r\n') % (f, tmpname))   util.copyfile(repo.wjoin(f), tmpname)   backups[f] = tmpname   @@ -489,14 +489,14 @@
    # 3b. apply filtered patch to clean repo (apply)   if dopatch: - ui.debug('applying patch\n') + ui.debug(_('applying patch\n'))   ui.debug(fp.getvalue())   patch.internalpatch(fp, ui, 1, repo.root)   del fp     # 3c. apply filtered patch to clean repo (shelve)   if doshelve: - ui.debug("saving patch to shelve\n") + ui.debug(_('saving patch to shelve\n'))   if opts['append']:   f = repo.opener('shelve', "a")   else: @@ -507,9 +507,9 @@
  except:   try:   for realname, tmpname in backups.iteritems(): - ui.debug('restoring %r to %r\n' % (tmpname, realname)) + ui.debug(_('restoring %r to %r\n') % (tmpname, realname))   util.copyfile(tmpname, repo.wjoin(realname)) - ui.debug('removing shelve file\n') + ui.debug(_('removing shelve file\n'))   os.unlink(repo.join('shelve'))   except OSError:   pass @@ -518,7 +518,7 @@
  finally:   try:   for realname, tmpname in backups.iteritems(): - ui.debug('removing backup for %r : %r\n' % (realname, tmpname)) + ui.debug(_('removing backup for %r : %r\n') % (realname, tmpname))   os.unlink(tmpname)   os.rmdir(backupdir)   except OSError: @@ -543,7 +543,7 @@
  backupdir = repo.join('shelve-backups')   backups = makebackup(ui, repo, backupdir, set(files))   - ui.debug('applying shelved patch\n') + ui.debug(_('applying shelved patch\n'))   patchdone = 0   try:   try: @@ -556,24 +556,24 @@
  if opts['force']:   patchdone = 1   else: - ui.status('restoring backup files\n') + ui.status(_('restoring backup files\n'))   for realname, tmpname in backups.iteritems(): - ui.debug('restoring %r to %r\n' % + ui.debug(_('restoring %r to %r\n') %   (tmpname, realname))   util.copyfile(tmpname, repo.wjoin(realname))   finally:   try: - ui.debug('removing backup files\n') + ui.debug(_('removing backup files\n'))   shutil.rmtree(backupdir, True)   except OSError:   pass     if patchdone: - ui.debug("removing shelved patches\n") + ui.debug(_('removing shelved patches\n'))   os.unlink(repo.join('shelve')) - ui.status("unshelve completed\n") + ui.status(_('unshelve completed\n'))   except IOError: - ui.warn('nothing to unshelve\n') + ui.warn(_('nothing to unshelve\n'))    cmdtable = {   "shelve":
Change 1 of 2 Show Entire File hggtk/​hgtk.py Stacked
 
217
218
219
220
 
221
222
223
 
479
480
481
482
 
483
484
485
 
217
218
219
 
220
221
222
223
 
479
480
481
 
482
483
484
485
@@ -217,7 +217,7 @@
  """rename a single file or directory"""   from hggtk.rename import run   if not pats or len(pats) > 2: - raise util.Abort("rename takes one or two path arguments") + raise util.Abort(_('rename takes one or two path arguments'))   opts['files'] = pats   opts['detect'] = False   run(**opts) @@ -479,7 +479,7 @@
 def version(ui, **opts):   """output version and copyright information"""   import hggtk.shlib - ui.write("TortoiseHg Dialogs (version %s)\n" % hggtk.shlib.version()) + ui.write(_('TortoiseHg Dialogs (version %s)\n') % hggtk.shlib.version())   if not ui.quiet:   ui.write(shortlicense)  
Change 1 of 12 Show Entire File hggtk/​history.py Stacked
 
14
15
16
 
17
18
19
 
47
48
49
50
 
51
52
 
53
54
55
 
56
57
58
 
59
60
61
 
62
63
 
64
65
66
 
127
128
129
130
 
131
132
133
134
135
136
 
137
138
139
140
141
142
 
143
144
145
 
151
152
153
154
 
155
156
 
157
158
159
160
 
 
161
162
163
164
 
 
165
166
167
168
 
 
169
170
171
172
 
 
173
174
175
176
 
 
177
178
179
 
180
181
182
 
313
314
315
316
317
318
 
 
 
319
320
321
322
323
324
325
 
 
 
 
 
 
326
327
328
329
330
 
331
332
333
 
338
339
340
341
342
 
 
343
344
345
 
 
 
 
346
347
348
 
389
390
391
392
 
393
394
 
395
396
397
 
418
419
420
421
422
 
 
423
424
425
 
445
446
447
448
449
450
 
 
 
451
452
453
 
499
500
501
502
 
503
504
505
 
540
541
542
543
 
544
545
546
 
566
567
568
569
 
570
571
572
 
14
15
16
17
18
19
20
 
48
49
50
 
51
52
 
53
54
55
 
56
57
58
 
59
60
61
 
62
63
 
64
65
66
67
 
128
129
130
 
131
132
133
134
135
136
 
137
138
139
140
141
142
 
143
144
145
146
 
152
153
154
 
155
156
 
157
158
159
 
 
160
161
162
163
 
 
164
165
166
167
 
 
168
169
170
171
 
 
172
173
174
175
 
 
176
177
178
179
 
180
181
182
183
 
314
315
316
 
 
 
317
318
319
320
 
 
 
 
 
 
321
322
323
324
325
326
327
328
329
330
 
331
332
333
334
 
339
340
341
 
 
342
343
344
 
 
345
346
347
348
349
350
351
 
392
393
394
 
395
396
 
397
398
399
400
 
421
422
423
 
 
424
425
426
427
428
 
448
449
450
 
 
 
451
452
453
454
455
456
 
502
503
504
 
505
506
507
508
 
543
544
545
 
546
547
548
549
 
569
570
571
 
572
573
574
575
@@ -14,6 +14,7 @@
 import StringIO    from mercurial.node import * +from mercurial.i18n import _  from mercurial import ui, hg, commands, extensions  from gdialog import *  from changeset import ChangeSet @@ -47,20 +48,20 @@
  def get_tbbuttons(self):   return [   self.make_toolbutton(gtk.STOCK_REFRESH, - 'Re_fresh', + _('Re_fresh'),   self._refresh_clicked, - tip='Reload revision history'), + tip=_('Reload revision history')),   gtk.SeparatorToolItem(),   self.make_toolbutton(gtk.STOCK_INDEX, - '_Filter', + _('_Filter'),   self._filter_clicked,   menu=self._filter_menu(), - tip='Filter revisions for display'), + tip=_('Filter revisions for display')),   gtk.SeparatorToolItem(),   self.make_toolbutton(gtk.STOCK_FIND, - '_DataMine', + _('_DataMine'),   self._datamine_clicked, - tip='Search Repository History'), + tip=_('Search Repository History')),   gtk.SeparatorToolItem()   ] + self.changeview.get_tbbuttons()   @@ -127,19 +128,19 @@
  def _view_menu(self):   menu = gtk.Menu()   - button = gtk.CheckMenuItem("Show Rev") + button = gtk.CheckMenuItem(_('Show Rev'))   button.connect("toggled", self.toggle_view_column,   'rev-column-visible')   button.set_active(self._show_rev)   button.set_draw_as_radio(True)   menu.append(button) - button = gtk.CheckMenuItem("Show ID") + button = gtk.CheckMenuItem(_('Show ID'))   button.connect("toggled", self.toggle_view_column,   'id-column-visible')   button.set_active(self._show_id)   button.set_draw_as_radio(True)   menu.append(button) - button = gtk.CheckMenuItem("Show Date") + button = gtk.CheckMenuItem(_('Show Date'))   button.connect("toggled", self.toggle_view_column,   'date-column-visible')   button.set_active(self._show_date) @@ -151,32 +152,32 @@
  def _filter_menu(self):   menu = gtk.Menu()   - button = gtk.RadioMenuItem(None, "Show All Revisions") + button = gtk.RadioMenuItem(None, _('Show All Revisions'))   button.set_active(True) - button.connect("toggled", self._filter_selected, 'all') + button.connect('toggled', self._filter_selected, 'all')   menu.append(button)   - button = gtk.RadioMenuItem(button, "Show Tagged Revisions") - button.connect("toggled", self._filter_selected, 'tagged') + button = gtk.RadioMenuItem(button, _('Show Tagged Revisions')) + button.connect('toggled', self._filter_selected, 'tagged')   menu.append(button)   - button = gtk.RadioMenuItem(button, "Show Parent Revisions") - button.connect("toggled", self._filter_selected, 'parents') + button = gtk.RadioMenuItem(button, _('Show Parent Revisions')) + button.connect('toggled', self._filter_selected, 'parents')   menu.append(button)   - button = gtk.RadioMenuItem(button, "Show Head Revisions") - button.connect("toggled", self._filter_selected, 'heads') + button = gtk.RadioMenuItem(button, _('Show Head Revisions')) + button.connect('toggled', self._filter_selected, 'heads')   menu.append(button)   - button = gtk.RadioMenuItem(button, "Show Only Merge Revisions") - button.connect("toggled", self._filter_selected, 'only_merges') + button = gtk.RadioMenuItem(button, _('Show Only Merge Revisions')) + button.connect('toggled', self._filter_selected, 'only_merges')   menu.append(button)   - button = gtk.RadioMenuItem(button, "Show Non-Merge Revisions") - button.connect("toggled", self._filter_selected, 'no_merges') + button = gtk.RadioMenuItem(button, _('Show Non-Merge Revisions')) + button.connect('toggled', self._filter_selected, 'no_merges')   menu.append(button)   - self.custombutton = gtk.RadioMenuItem(button, "Custom Filter") + self.custombutton = gtk.RadioMenuItem(button, _('Custom Filter'))   self.custombutton.set_sensitive(False)   menu.append(self.custombutton)   @@ -313,21 +314,21 @@
    def tree_context_menu(self):   _menu = gtk.Menu() - _menu.append(create_menu('di_splay', self._show_status)) - _menu.append(create_menu('_update', self._checkout)) - self._cmenu_merge = create_menu('_merge with', self._merge) + _menu.append(create_menu(_('di_splay'), self._show_status)) + _menu.append(create_menu(_('_update'), self._checkout)) + self._cmenu_merge = create_menu(_('_merge with'), self._merge)   _menu.append(self._cmenu_merge) - _menu.append(create_menu('_export patch', self._export_patch)) - _menu.append(create_menu('e_mail patch', self._email_patch)) - _menu.append(create_menu('_bundle rev:tip', self._bundle_rev_to_tip)) - _menu.append(create_menu('add/remove _tag', self._add_tag)) - _menu.append(create_menu('backout revision', self._backout_rev)) - _menu.append(create_menu('_revert', self._revert)) + _menu.append(create_menu(_('_export patch'), self._export_patch)) + _menu.append(create_menu(_('e_mail patch'), self._email_patch)) + _menu.append(create_menu(_('_bundle rev:tip'), self._bundle_rev_to_tip)) + _menu.append(create_menu(_('add/remove _tag'), self._add_tag)) + _menu.append(create_menu(_('backout revision'), self._backout_rev)) + _menu.append(create_menu(_('_revert'), self._revert))     # need mq extension for strip command   extensions.loadall(self.ui)   extensions.load(self.ui, 'mq', None) - _menu.append(create_menu('strip revision', self._strip_rev)) + _menu.append(create_menu(_('strip revision'), self._strip_rev))     _menu.show_all()   return _menu @@ -338,11 +339,13 @@
    def tree_diff_context_menu(self):   _menu = gtk.Menu() - _menu.append(create_menu('_diff with selected', self._diff_revs)) - _menu.append(create_menu('visual diff with selected', + _menu.append(create_menu(_('_diff with selected'), self._diff_revs)) + _menu.append(create_menu(_('visual diff with selected'),   self._vdiff_selected)) - _menu.append(create_menu('email from here to selected', self._email_revs)) - _menu.append(create_menu('bundle from here to selected', self._bundle_revs)) + _menu.append(create_menu(_('email from here to selected'), + self._email_revs)) + _menu.append(create_menu(_('bundle from here to selected'), + self._bundle_revs))   _menu.connect_after('selection-done', self._restore_original_selection)   _menu.show_all()   return _menu @@ -389,9 +392,9 @@
  vbox.pack_start(self.allbutton, False, False)     self.nextbutton.set_tooltip(self.tooltips, - 'show next %d revisions' % self.limit) + _('show next %d revisions') % self.limit)   self.allbutton.set_tooltip(self.tooltips, - 'show all remaining revisions') + _('show all remaining revisions'))     hbox.pack_start(vbox, False, False, 0)   self.tree_frame.add(hbox) @@ -418,8 +421,8 @@
    def _strip_rev(self, menuitem):   rev = self.currow[treemodel.REVID] - res = Confirm('Strip Revision(s)', [], self, - 'Remove revision %d and all descendants?' % rev).run() + res = Confirm(_('Strip Revision(s)'), [], self, + _('Remove revision %d and all descendants?') % rev).run()   if res != gtk.RESPONSE_YES:   return   from hgcmd import CmdDialog @@ -445,9 +448,9 @@
    def _revert(self, menuitem):   rev = self.currow[treemodel.REVID] - res = Confirm('Revert Revision(s)', [], self, - 'Revert all files to revision %d?\nThis will overwrite your ' - 'local changes' % rev).run() + res = Confirm(_('Revert Revision(s)'), [], self, + _('Revert all files to revision %d?\nThis will overwrite your ' + 'local changes') % rev).run()     if res != gtk.RESPONSE_YES:   return @@ -499,7 +502,7 @@
    filename = "%s_rev%d_to_rev%s.hg" % (os.path.basename(self.repo.root),   revs[0], revs[1]) - result = NativeSaveFileDialogWrapper(Title = "Write bundle to", + result = NativeSaveFileDialogWrapper(Title=_('Write bundle to'),   InitialDir=self.repo.root,   FileName=filename).run()   if result: @@ -540,7 +543,7 @@
  def _export_patch(self, menuitem):   rev = self.currow[treemodel.REVID]   filename = "%s_rev%s.patch" % (os.path.basename(self.repo.root), rev) - fd = NativeSaveFileDialogWrapper(Title = "Save patch to", + fd = NativeSaveFileDialogWrapper(Title=_('Save patch to'),   InitialDir=self.repo.root,   FileName=filename)   result = fd.run() @@ -566,7 +569,7 @@
  except (ValueError, LookupError):   return   filename = "%s_rev%d_to_tip.hg" % (os.path.basename(self.repo.root), rev) - result = NativeSaveFileDialogWrapper(Title = "Write bundle to", + result = NativeSaveFileDialogWrapper(Title=_('Write bundle to'),   InitialDir=self.repo.root,   FileName=filename).run()   if result: