Changeset 678b19227b0f…
Parent 506e0cbf5ec2…
by
Changes to one file · Browse files at 678b19227b0f Showing diff from parent 506e0cbf5ec2 Diff from another changeset...
@@ -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
|
Loading...