Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

gtklib: define and use common colors

Changeset aec85547f364

Parent eb33ba1bbf91

by Yuki KODAMA

Changes to 13 files · Browse files at aec85547f364 Showing diff from parent eb33ba1bbf91 Diff from another changeset...

 
570
571
572
573
 
574
575
576
 
583
584
585
586
 
587
588
589
 
570
571
572
 
573
574
575
576
 
583
584
585
 
586
587
588
589
@@ -570,7 +570,7 @@
  def widget_func(widget, item, markups):   def linkwidget(revnum, revid, summary, highlight=None, branch=None):   # revision label - opts = dict(underline='single', foreground='#0000FF') + opts = dict(underline='single', color='blue')   if highlight:   opts['weight'] = 'bold'   rev = '%s (%s)' % (gtklib.markup(revnum, **opts), @@ -583,7 +583,7 @@
  sum = gtklib.markup(summary)   if branch:   sum = gtklib.markup(branch, color='black', - background='#aaffaa') + ' ' + sum + background=gtklib.PGREEN) + ' ' + sum   sumlabel = gtk.Label()   sumlabel.set_markup(sum)   sumlabel.set_selectable(True)
 
408
409
410
411
 
412
413
414
 
408
409
410
 
411
412
413
414
@@ -408,7 +408,7 @@
  def markup_func(widget, item, value):   if item == 'athead' and value is False:   text = '[%s]' % _('Not at head') - return gtklib.markup(text, weight='bold', color='#880000') + return gtklib.markup(text, weight='bold', color=gtklib.DRED)   raise csinfo.UnknownItem(item)   custom = csinfo.custom(data=data_func, markup=markup_func)   factory = csinfo.factory(self.repo, custom, style)
 
337
338
339
340
 
341
342
 
343
344
345
 
337
338
339
 
340
341
 
342
343
344
345
@@ -337,9 +337,9 @@
  return str(value)   elif item in ('rawbranch', 'branch'):   return gtklib.markup(' %s ' % value, color='black', - background='#aaffaa') + background=gtklib.PGREEN)   elif item in ('rawtags', 'tags'): - opts = dict(color='black', background='#ffffaa') + opts = dict(color='black', background=gtklib.PYELLOW)   tags = [gtklib.markup(' %s ' % tag, **opts) for tag in value]   return ' '.join(tags)   elif item in ('desc', 'summary', 'user', 'date', 'age'):
 
29
30
31
 
 
 
 
 
 
 
 
 
 
 
 
32
33
34
 
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
@@ -29,6 +29,18 @@
  # http://www.mail-archive.com/tortoisehg-develop@lists.sourceforge.net/msg06900.html   raise Exception('incompatible version of gobject')   +# common colors + +DRED = '#900000' +DGREEN = '#006400' +DBLUE = '#000090' + +PRED = '#ffcccc' +PGREEN = '#aaffaa' +PBLUE = '#aaddff' +PYELLOW = '#ffffaa' +PORANGE = '#ffddaa' +  def set_tortoise_icon(window, thgicon):   ico = paths.get_tortoise_icon(thgicon)   if ico: window.set_icon_from_file(ico)
 
194
195
196
197
198
 
 
199
200
 
201
202
203
 
194
195
196
 
 
197
198
199
 
200
201
202
203
@@ -194,10 +194,10 @@
    #$$ text view for diff   self.buf = gtk.TextBuffer() - self.buf.create_tag('removed', foreground='#900000') - self.buf.create_tag('added', foreground='#006400') + self.buf.create_tag('removed', foreground=gtklib.DRED) + self.buf.create_tag('added', foreground=gtklib.DGREEN)   self.buf.create_tag('position', foreground='#FF8000') - self.buf.create_tag('header', foreground='#000090') + self.buf.create_tag('header', foreground=gtklib.DBLUE)   diffview = gtk.TextView(self.buf)   scroller.add(diffview)   diffview.modify_font(pango.FontDescription('monospace'))
 
88
89
90
91
 
92
93
94
 
384
385
386
387
 
388
389
390
 
391
392
393
 
394
395
396
 
566
567
568
569
 
570
571
572
 
88
89
90
 
91
92
93
94
 
384
385
386
 
387
388
389
 
390
391
392
 
393
394
395
396
 
566
567
568
 
569
570
571
572
@@ -88,7 +88,7 @@
  scrolledwindow.add(self.textview)   self.textbuffer = self.textview.get_buffer()   self.textbuffer.create_tag('error', weight=pango.WEIGHT_HEAVY, - foreground='#900000') + foreground=gtklib.DRED)     self.vbox.pack_start(scrolledwindow, True, True)   self.connect('map_event', self._on_window_map_event) @@ -384,13 +384,13 @@
  """   markup = '<span foreground="%s" weight="%s">%%s</span>'   if style in ('succeed', 'green', 'ok'): - markup = markup % ('#007700', 'bold') + markup = markup % (gtklib.DGREEN, 'bold')   icons = {'succeed': True}   elif style in ('error', 'failed', 'fail', 'red'): - markup = markup % ('#880000', 'bold') + markup = markup % (gtklib.DRED, 'bold')   icons = {'error': True}   else: - markup = markup % ('#000000', 'normal') + markup = markup % ('black', 'normal')   icons = {}   text = gtklib.markup_escape_text(text)   self.rlabel.set_markup(markup % text) @@ -566,7 +566,7 @@
  # text buffer   self.buffer = self.textview.get_buffer()   self.buffer.create_tag('error', weight=pango.WEIGHT_HEAVY, - foreground='#900000') + foreground=gtklib.DRED)     ### public functions ###  
 
187
188
189
190
 
191
192
 
193
194
195
196
197
198
199
 
200
201
202
 
229
230
231
232
 
233
234
 
235
236
 
237
238
239
 
187
188
189
 
190
191
 
192
193
194
195
196
197
198
 
199
200
201
202
 
229
230
231
 
232
233
 
234
235
 
236
237
238
239
@@ -187,16 +187,16 @@
  tstr = ''   for tag in tags:   if tag not in self.hidetags: - style = {'color':'black', 'background':'#ffffaa'} + style = {'color':'black', 'background':gtklib.PYELLOW}   if tag == currentBookmark: - style['background'] = '#ffcc99' + style['background'] = gtklib.PORANGE   tstr += gtklib.markup(' %s ' % tag, **style) + ' '     branch = ctx.branch()   bstr = ''   if self.branchtags.get(branch) == node:   bstr += gtklib.markup(' %s ' % branch, color='black', - background='#aaffaa') + ' ' + background=gtklib.PGREEN) + ' '     author = hglib.toutf(hglib.username(ctx.user()))   age = hglib.age(ctx.date()) @@ -229,11 +229,11 @@
  M, A, R = self.repo.status(ctx.parents()[0].node(), ctx.node())[:3]   common = dict(color='black')   M = M and gtklib.markup(' %s ' % len(M), - background='#ffddaa', **common) or '' + background=gtklib.PORANGE, **common) or ''   A = A and gtklib.markup(' %s ' % len(A), - background='#aaffaa', **common) or '' + background=gtklib.PGREEN, **common) or ''   R = R and gtklib.markup(' %s ' % len(R), - background='#ffcccc', **common) or '' + background=gtklib.PRED, **common) or ''   changes = ''.join((M, A, R))     revision = (sumstr, author, taglist, color, age, changes, status)
 
86
87
88
89
 
90
91
92
 
86
87
88
 
89
90
91
92
@@ -86,7 +86,7 @@
  scrolledwindow.add(self.textview)   self.textbuffer = self.textview.get_buffer()   self.textbuffer.create_tag('error', weight=pango.WEIGHT_HEAVY, - foreground='#900000') + foreground=gtklib.DRED)   vbox.pack_start(scrolledwindow, True, True)     self.stbar = statusbar.StatusBar()
 
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
67
 
68
69
70
 
833
834
835
836
 
837
838
 
839
840
 
841
842
843
 
1002
1003
1004
1005
1006
 
 
1007
1008
 
1009
1010
1011
 
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
 
67
68
69
70
 
833
834
835
 
836
837
 
838
839
 
840
841
842
843
 
1002
1003
1004
 
 
1005
1006
1007
 
1008
1009
1010
1011
@@ -41,30 +41,30 @@
   def hunk_markup(text):   'Format a diff hunk for display in a TreeView row with markup' - hunk = "" + hunk = ''   # don't use splitlines, should split with only LF for the patch   lines = hglib.tounicode(text).split(u'\n')   for line in lines: - line = gtklib.markup_escape_text(hglib.toutf(line[:512])) + '\n' + line = hglib.toutf(line[:512]) + '\n'   if line.startswith('---') or line.startswith('+++'): - hunk += '<span foreground="#000090">%s</span>' % line + hunk += gtklib.markup(line, color=gtklib.DBLUE)   elif line.startswith('-'): - hunk += '<span foreground="#900000">%s</span>' % line + hunk += gtklib.markup(line, color=gtklib.DRED)   elif line.startswith('+'): - hunk += '<span foreground="#006400">%s</span>' % line + hunk += gtklib.markup(line, color=gtklib.DGREEN)   elif line.startswith('@@'): - hunk = '<span foreground="#FF8000">%s</span>' % line + hunk = gtklib.markup(line, color='#FF8000')   else:   hunk += line   return hunk    def hunk_unmarkup(text):   'Format a diff hunk for display in a TreeView row without markup' - hunk = "" + hunk = ''   # don't use splitlines, should split with only LF for the patch   lines = hglib.tounicode(text).split(u'\n')   for line in lines: - hunk += gtklib.markup_escape_text(hglib.toutf(line[:512])) + '\n' + hunk += gtklib.markup(hglib.toutf(line[:512])) + '\n'   return hunk    class GStatus(gdialog.GDialog): @@ -833,11 +833,11 @@
  def text_color(self, column, text_renderer, model, row_iter):   stat = model[row_iter][FM_STATUS]   if stat == 'M': - text_renderer.set_property('foreground', '#000090') + text_renderer.set_property('foreground', gtklib.DBLUE)   elif stat == 'A': - text_renderer.set_property('foreground', '#006400') + text_renderer.set_property('foreground', gtklib.DGREEN)   elif stat == 'R': - text_renderer.set_property('foreground', '#900000') + text_renderer.set_property('foreground', gtklib.DRED)   elif stat == 'C':   text_renderer.set_property('foreground', 'black')   elif stat == '!': @@ -1002,10 +1002,10 @@
    def diff_highlight_buffer(self, difftext):   buf = gtk.TextBuffer() - buf.create_tag('removed', foreground='#900000') - buf.create_tag('added', foreground='#006400') + buf.create_tag('removed', foreground=gtklib.DRED) + buf.create_tag('added', foreground=gtklib.DGREEN)   buf.create_tag('position', foreground='#FF8000') - buf.create_tag('header', foreground='#000090') + buf.create_tag('header', foreground=gtklib.DBLUE)     bufiter = buf.get_start_iter()   for line in difftext:
 
245
246
247
248
 
249
250
251
 
245
246
247
 
248
249
250
251
@@ -245,7 +245,7 @@
  self.textview.connect('populate-popup', self.add_to_popup)   self.textbuffer = self.textview.get_buffer()   self.textbuffer.create_tag('error', weight=pango.WEIGHT_HEAVY, - foreground='#900000') + foreground=gtklib.DRED)   basevbox.pack_start(scrolledwindow, True, True)     # statusbar
 
293
294
295
 
296
297
298
 
299
300
301
 
302
303
304
 
 
305
306
307
 
293
294
295
296
297
 
 
298
299
 
 
300
301
 
 
302
303
304
305
306
@@ -293,15 +293,14 @@
    def update_status(self, count):   if count: + inner = gtklib.markup(_('%s patches') % count, weight='bold')   if self.mqloaded: - info = _('<span weight="bold">%s patches</span> will' - ' be imported to the') % count + info = _('%s will be imported to the') % inner   else: - info = _('<span weight="bold">%s patches</span> will' - ' be imported to the repository') % count + info = _('%s will be imported to the repository') % inner   else: - info = '<span weight="bold" foreground="#880000">%s</span>' \ - % _('Nothing to import') + info = gtklib.markup(_('Nothing to import'), + weight='bold', color=gtklib.DRED)   self.infolbl.set_markup(info)   if self.mqloaded:   self.dest_combo.set_property('visible', bool(count))
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
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
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
 
 
203
204
205
 
 
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
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
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
 
 
201
202
203
 
 
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
 # thgstrip.py - strip dialog for TortoiseHg  #  # Copyright 2009 Yuki KODAMA <endflow.net@gmail.com>  #  # This software may be used and distributed according to the terms of the  # GNU General Public License version 2, incorporated herein by reference.    import re  import os  import gtk  import gobject  import pango    from mercurial import hg, ui, error  from mercurial.node import nullrev    from tortoisehg.util.i18n import _  from tortoisehg.util import hglib, paths    from tortoisehg.hgtk import csinfo, hgcmd, gtklib, gdialog, cslist    MODE_NORMAL = 'normal'  MODE_WORKING = 'working'    class StripDialog(gtk.Dialog):   """ Dialog to strip changesets """     def __init__(self, rev=None, *pats):   """ Initialize the Dialog """   gtk.Dialog.__init__(self)   gtklib.set_tortoise_icon(self, 'menudelete.ico')   gtklib.set_tortoise_keys(self)   self.set_default_size(480, 360)   self.set_has_separator(False)     # buttons   self.stripbtn = self.add_button(_('Strip'), gtk.RESPONSE_OK)   self.closebtn = self.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)     try:   repo = hg.repository(ui.ui(), path=paths.find_root())   except error.RepoError:   gtklib.idle_add_single_call(self.destroy)   return   self.repo = repo   self.set_title(_('Strip - %s') % hglib.get_reponame(repo))     if len(pats) > 0:   rev = pats[0]   elif rev is None:   rev = 'tip'   rev = str(rev)     # layout table   self.table = table = gtklib.LayoutTable()   self.vbox.pack_start(table, True, True, 2)     ## target revision combo   self.revcombo = gtk.combo_box_entry_new_text()   table.add_row(_('Strip:'), self.revcombo)   reventry = self.revcombo.child   reventry.set_width_chars(32)     ### fill combo list   self.revcombo.append_text(rev)   self.revcombo.set_active(0)   dblist = repo.ui.config('tortoisehg', 'deadbranch', '')   deadbranches = [ x.strip() for x in dblist.split(',') ]   for name in repo.branchtags().keys():   if name not in deadbranches:   self.revcombo.append_text(name)     tags = list(repo.tags())   tags.sort()   tags.reverse()   for tag in tags:   self.revcombo.append_text(tag)     def createlabel():   label = gtk.Label()   label.set_alignment(0, 0.5)   label.set_size_request(-1, 24)   label.size_request()   return label     ## result label   self.resultlbl = createlabel()   table.add_row(_('Preview:'), self.resultlbl, padding=False)     ## changeset list   self.cslist = cslist.ChangesetList()   table.add_row(None, self.cslist, padding=False,   yopt=gtk.FILL|gtk.EXPAND)     ## options   self.expander = gtk.Expander(_('Options:'))   self.expander.connect('notify::expanded', self.options_expanded)     ### force option (fixed)   self.forceopt = gtk.CheckButton(_('Discard local changes, no backup'   ' (-f/--force)'))   table.add_row(self.expander, self.forceopt)     # signal handlers   self.connect('response', self.dialog_response)   reventry.connect('activate', lambda b: self.response(gtk.RESPONSE_OK))   self.revcombo.connect('changed', lambda c: self.preview(queue=True))   self.cslist.connect('list-updated', self.preview_updated)     # prepare to show   self.preview()   self.stripbtn.grab_focus()   gtklib.idle_add_single_call(self.after_init)     def after_init(self):   # backup types (foldable)   self.butable = gtklib.LayoutTable()   self.vbox.pack_start(self.butable, False, False)   def add_type(desc):   group = hasattr(self, 'buopt_all') and self.buopt_all or None   radio = gtk.RadioButton(group, desc)   self.butable.add_row(None, radio, ypad=0)   return radio   self.buopt_all = add_type(_('Backup all (default)'))   self.buopt_part = add_type(_('Backup unrelated changesets'   ' (-b/--backup)'))   self.buopt_none = add_type(_('No backup (-n/--nobackup)'))     # layout group   layout = gtklib.LayoutGroup()   layout.add(self.table, self.butable, force=True)     # CmdWidget   self.cmd = hgcmd.CmdWidget()   self.cmd.show_all()   self.cmd.hide()   self.vbox.pack_start(self.cmd, False, False, 6)     # abort button   self.abortbtn = self.add_button(_('Abort'), gtk.RESPONSE_CANCEL)   self.abortbtn.hide()     def set_notify_func(self, func, *args, **kargs):   self.notify_func = func   self.notify_args = args   self.notify_kargs = kargs     def preview(self, limit=True, queue=False, force=False):   # check revision   rev = self.get_rev()   if rev is None:   self.cslist.clear()   return     # enumerate all descendants   # borrowed from strip() in 'mercurial/repair.py'   cl = self.repo.changelog   tostrip = [rev,]   for r in xrange(rev + 1, len(cl)):   parents = cl.parentrevs(r)   if parents[0] in tostrip or parents[1] in tostrip:   tostrip.append(r)     # update preview   self.cslist.update(tostrip, self.repo, limit, queue)     def dialog_response(self, dialog, response_id):   def abort():   self.cmd.stop()   self.cmd.show_log()   self.switch_to(MODE_NORMAL, cmd=False)   # Strip button   if response_id == gtk.RESPONSE_OK:   self.strip()   # Close button or dialog closing by the user   elif response_id in (gtk.RESPONSE_CLOSE, gtk.RESPONSE_DELETE_EVENT):   if self.cmd.is_alive():   ret = gdialog.Confirm(_('Confirm Abort'), [], self,   _('Do you want to abort?')).run()   if ret == gtk.RESPONSE_YES:   abort()   else:   self.destroy()   return # close dialog   # Abort button   elif response_id == gtk.RESPONSE_CANCEL:   abort()   else:   raise _('unexpected response id: %s') % response_id     self.run() # don't close dialog     def options_expanded(self, expander, *args):   if expander.get_expanded():   self.butable.show_all()   else:   self.butable.hide()     def preview_updated(self, cslist, total, *args):   if total is None: - info = '<span weight="bold" foreground="#880000">%s</span>' \ - % _('Unknown revision!') + info = gtklib.markup(_('Unknown revision!'), + weight='bold', color=gtklib.DRED)   else: - info = _('<span weight="bold">%s changesets</span> will' - ' be stripped') % total + inner = gtklib.markup(_('%s changesets') % total, weight='bold') + info = _('%s will be stripped') % inner   self.resultlbl.set_markup(info)   self.stripbtn.set_sensitive(bool(total))     def get_rev(self):   """ Return integer revision number or None """   revstr = self.revcombo.get_active_text()   if revstr is None or len(revstr) == 0:   return None   try:   revnum = self.repo[revstr].rev()   except (error.RepoError, error.LookupError):   return None   return revnum     def switch_to(self, mode, cmd=True):   if mode == MODE_NORMAL:   normal = True   self.closebtn.grab_focus()   elif mode == MODE_WORKING:   normal = False   self.abortbtn.grab_focus()   else:   raise _('unknown mode name: %s') % mode   working = not normal     self.table.set_sensitive(normal)   self.butable.set_sensitive(normal)   self.stripbtn.set_property('visible', normal)   self.closebtn.set_property('visible', normal)   if cmd:   self.cmd.set_property('visible', working)   self.abortbtn.set_property('visible', working)     def strip(self):   def isclean():   '''whether WD is changed'''   wc = self.repo[None]   return not (wc.modified() or wc.added() or wc.removed())   revstr = self.revcombo.get_active_text()   cmdline = ['hg', 'strip', '--verbose', revstr]     # local changes   if self.forceopt.get_active():   cmdline.append('--force')   else:   if not isclean():   ret = gdialog.CustomPrompt(_('Confirm Strip'),   _('Detected uncommitted local changes.\nDo'   ' you want to discard them and continue?'),   self, (_('&Yes (--force)'), _('&No')),   default=1, esc=1).run()   if ret == 0:   cmdline.append('--force')   else:   return     # backup options   if self.buopt_part.get_active():   cmdline.append('--backup')   elif self.buopt_none.get_active():   cmdline.append('--nobackup')     def cmd_done(returncode, useraborted):   self.switch_to(MODE_NORMAL, cmd=False)   if returncode == 0:   if hasattr(self, 'notify_func'):   self.notify_func(*self.notify_args, **self.notify_kargs)   self.cmd.set_result(_('Stripped successfully'), style='ok')   self.after_strip()   elif useraborted:   self.cmd.set_result(_('Canceled stripping'), style='error')   else:   self.cmd.set_result(_('Failed to strip'), style='error')   self.switch_to(MODE_WORKING)   self.cmd.execute(cmdline, cmd_done)     def after_strip(self):   if self.buopt_none.get_active():   self.response(gtk.RESPONSE_CLOSE)   root = self.repo.root   bakdir = os.path.join(root, r'.hg\strip-backup')   escaped = bakdir.replace('\\', '\\\\')   buf = self.cmd.log.buffer   text = buf.get_text(buf.get_start_iter(), buf.get_end_iter())   m = re.search(escaped + r'\\[0-9abcdef]{12}-backup', text, re.I)   if m:   def open_bakdir():   gtklib.NativeFileManager(bakdir).run()   # backup bundle label & button   self.bubox = gtk.HBox()   self.vbox.pack_start(self.bubox, True, True, 2)   self.bulabel = gtk.Label(_('Saved at: %s') % m.group(0))   self.bubox.pack_start(self.bulabel, True, True, 8)   self.bulabel.set_alignment(0, 0.5)   self.bulabel.set_selectable(True)   self.bubtn = gtk.Button(_('Open...'))   self.bubox.pack_start(self.bubtn, False, False, 2)   self.bubtn.connect('clicked', lambda b: open_bakdir())   self.bubox.show_all()    def run(ui, *pats, **opts):   return StripDialog(None, *pats)
 
130
131
132
133
 
134
135
136
137
 
138
139
140
 
130
131
132
 
133
134
135
136
 
137
138
139
140
@@ -130,11 +130,11 @@
  if selected(i):   shunks += 1   slines += h.added + h.removed - str += "<span foreground='#000088'>" + str += '<span foreground="%s">' % gtklib.DBLUE   str += _('total: %d hunks (%d changed lines); '   'selected: %d hunks (%d changed lines)') % (hunks,   lines, shunks, slines) - str += "</span>" + str += '</span>'   break   str += hglib.toutf(h)   return str