Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

backout: use changesetinfo component instead of gtk.Label

Changeset 678b19227b0f

Parent 506e0cbf5ec2

by Yuki KODAMA

Changes to one file · Browse files at 678b19227b0f Showing diff from parent 506e0cbf5ec2 Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​backout.py Stacked
 
11
12
13
 
14
15
16
 
 
17
18
19
 
36
37
38
39
40
41
42
43
 
 
44
45
46
 
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
 
11
12
13
14
15
16
 
17
18
19
20
21
 
38
39
40
 
 
 
 
 
41
42
43
44
45
 
86
87
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
90
91
@@ -11,9 +11,11 @@
 import pango    from mercurial import hg, ui +  from thgutil.i18n import _  from thgutil import hglib, paths -from hggtk import gtklib, hgcmd + +from hggtk import changesetinfo, gtklib, hgcmd    class BackoutDialog(gtk.Window):   """ Backout effect of a changeset """ @@ -36,11 +38,8 @@
  self.add(vbox)     frame = gtk.Frame(_('Changeset Description')) - lbl = gtk.Label() - desc = self.revdesc(repo, rev) - lbl.set_markup(desc) - lbl.set_alignment(0, 0) - frame.add(lbl) + rev, desc = changesetinfo.changesetinfo(repo, rev) + frame.add(desc)   frame.set_border_width(5)   vbox.pack_start(frame, False, False, 2)   @@ -87,23 +86,6 @@
    backout.connect('clicked', self.backout, buf, rev)   - def revdesc(self, repo, revid): - ctx = repo[revid] - revstr = str(ctx.rev()) - summary = ctx.description().replace('\0', '') - summary = summary.split('\n')[0] - escape = gtklib.markup_escape_text - desc = '<b>' + hglib.fromutf(_('rev')) + '</b>\t\t: %s\n' % escape(revstr) - desc += '<b>' + hglib.fromutf(_('summary')) + '</b>\t: %s\n' % escape(summary[:80]) - desc += '<b>' + hglib.fromutf(_('user')) + '</b>\t\t: %s\n' % escape(ctx.user()) - desc += '<b>' + hglib.fromutf(_('date')) + '</b>\t\t: %s\n' % escape(hglib.displaytime(ctx.date())) - node = repo.lookup(revid) - tags = repo.nodetags(node) - desc += '<b>' + hglib.fromutf(_('branch')) + '</b>\t: ' + escape(ctx.branch()) - if tags: - desc += '\n<b>' + hglib.fromutf(_('tags')) + '</b>\t\t: ' + escape(', '.join(tags)) - return hglib.toutf(desc) -   def set_notify_func(self, func, *args):   self.notify_func = func   self.notify_args = args