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

stable csinfo: add 'withupdate' option, allows to update on instantiation

Changeset e38bc182bb88

Parent d608a408e596

by Yuki KODAMA

Changes to 4 files · Browse files at e38bc182bb88 Showing diff from parent d608a408e596 Diff from another changeset...

 
55
56
57
58
 
59
60
61
 
55
56
57
 
58
59
60
61
@@ -55,7 +55,7 @@
  # changeset info   style = csinfo.panelstyle(label=_('Changeset Description'),   margin=4, padding=2) - self.csetframe = csinfo.create(repo, rev, style) + self.csetframe = csinfo.create(repo, rev, style, withupdate=True)   self.vbox.pack_start(self.csetframe, False, False, 2)     # backout commit message
 
18
19
20
21
22
 
 
23
24
25
 
40
41
42
43
 
44
45
46
 
59
60
61
 
62
63
64
 
102
103
104
 
 
105
106
107
 
18
19
20
 
 
21
22
23
24
25
 
40
41
42
 
43
44
45
46
 
59
60
61
62
63
64
65
 
103
104
105
106
107
108
109
110
@@ -18,8 +18,8 @@
   PANEL_DEFAULT = ('rev', 'summary', 'user', 'date', 'branch', 'tags')   -def create(repo, rev=None, style=None, custom=None): - return CachedFactory(repo, custom, style, rev)() +def create(repo, rev=None, style=None, custom=None, **kargs): + return CachedFactory(repo, custom, style, rev, **kargs)()    def factory(*args, **kargs):   return CachedFactory(*args, **kargs) @@ -40,7 +40,7 @@
 class CachedFactory(object):     def __init__(self, repo=None, custom=None, style=None, rev=None, - widgetcache=False): + withupdate=False, widgetcache=False):   if repo is None:   try:   root = paths.find_root() @@ -59,6 +59,7 @@
  self.rev = rev   self.info = CachedChangesetInfo()   + self.withupdate = withupdate   if widgetcache:   self.cache = {}   @@ -102,6 +103,8 @@
  raise _("unknown 'type': %s") % type   if hasattr(self, 'cache'):   self.cache[key] = widget + if self.withupdate: + widget.update()   return widget   else:   raise _("must be specified 'type' in style")
 
76
77
78
79
 
80
81
82
83
84
85
86
87
88
89
90
91
 
92
93
94
 
76
77
78
 
79
80
81
82
 
83
84
85
86
87
 
88
 
89
90
91
92
@@ -76,19 +76,17 @@
  return ''   return gtklib.markup(_('Not a head revision!'), weight='bold')   custom = csinfo.custom(ishead={'markup': markup_func}) - factory = csinfo.factory(repo, custom, style) + factory = csinfo.factory(repo, custom, style, withupdate=True)     info = factory(rev1, style={'label': _('Merge target (other)')})   self.vbox.pack_start(info, False, False) - info.update()   self.otherframe = info   self.otherrev = info.get_data('revnum')     info = factory(rev0, style={'label': _('Current revision (local)')})   self.vbox.pack_start(info, False, False) - info.update()   self.localframe = info - self.localrev = '???' + self.localrev = info.get_data('revnum')     # buttons   self.mergebtn = self.add_button(_('Merge'), RESPONSE_MERGE)
 
127
128
129
130
 
131
132
133
 
240
241
242
243
244
245
246
 
127
128
129
 
130
131
132
133
 
240
241
242
 
243
244
245
@@ -127,7 +127,7 @@
  self.allbtn.connect('clicked', lambda b: self.preview(limit=False))     # csetinfo factory - self.factory = csinfo.factory(repo, widgetcache=True) + self.factory = csinfo.factory(repo, withupdate=True, widgetcache=True)   self.lstyle = csinfo.labelstyle(contents=('%(revnum)s:',   ' %(branch)s', ' %(tags)s', ' %(summary)s'))   self.pstyle = csinfo.panelstyle() @@ -240,7 +240,6 @@
  if info.parent:   info.parent.remove(info)   self.resultbox.pack_start(info, False, False, 2) - info.update()   def add_sep():   if not compactview:   self.resultbox.pack_start(gtk.HSeparator(), False, False)