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: move 'transplant' to csinfo's preset data

Changeset d9b4ffce954a

Parent 35c2f3bcc583

by Yuki KODAMA

Changes to 2 files · Browse files at d9b4ffce954a Showing diff from parent 35c2f3bcc583 Diff from another changeset...

 
10
11
12
13
14
15
16
 
456
457
458
459
 
 
 
460
461
462
463
464
465
466
467
468
 
 
 
 
469
470
471
 
481
482
483
484
485
486
487
488
 
10
11
12
 
13
14
15
 
455
456
457
 
458
459
460
461
 
 
 
 
 
 
 
 
462
463
464
465
466
467
468
 
478
479
480
 
 
481
482
483
@@ -10,7 +10,6 @@
 import gobject  import pango  import Queue -import binascii    from mercurial import cmdutil, util, patch, mdiff   @@ -456,16 +455,14 @@
  elif item == 'children':   return [revline_data(ctx) for ctx in ctx.children()]   elif item == 'transplant': - extra = ctx.extra() + ts = widget.get_data('transplant', usepreset=True) + if not ts: + return None   try: - ts = extra['transplant_source'] - try: - tctx = self.repo[ts] - return revline_data(tctx) - except (hglib.LookupError, hglib.RepoLookupError, hglib.RepoError): - return binascii.hexlify(ts) - except KeyError: - return None + tctx = self.repo[ts] + return revline_data(tctx) + except (hglib.LookupError, hglib.RepoLookupError, hglib.RepoError): + return ts   elif item == 'patch':   if hasattr(ctx, '_patchname'):   desc = ctx.description() @@ -481,8 +478,6 @@
  return _('Parent:')   elif item == 'children':   return _('Child:') - elif item == 'transplant': - return _('Transplant:')   elif item == 'patch':   return _('Patch:')   raise csinfo.UnknownItem(item)
 
10
11
12
 
13
14
15
 
19
20
21
22
 
23
24
25
 
191
192
193
194
 
 
195
196
197
 
257
258
259
 
 
 
 
 
 
 
 
 
260
261
262
 
300
301
302
303
 
304
305
306
 
334
335
336
337
 
338
339
340
 
357
358
359
360
 
361
362
363
364
 
 
365
366
367
 
 
368
369
370
 
 
371
372
373
 
10
11
12
13
14
15
16
 
20
21
22
 
23
24
25
26
 
192
193
194
 
195
196
197
198
199
 
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
 
311
312
313
 
314
315
316
317
 
345
346
347
 
348
349
350
351
 
368
369
370
 
371
372
373
 
 
374
375
376
 
 
377
378
379
 
 
380
381
382
383
384
@@ -10,6 +10,7 @@
 import re  import os  import gtk +import binascii    from mercurial import patch, util  from mercurial.node import short, hex @@ -19,7 +20,7 @@
   from tortoisehg.hgtk import gtklib   -PANEL_DEFAULT = ('rev', 'summary', 'user', 'date', 'branch', 'tags') +PANEL_DEFAULT = ('rev', 'summary', 'user', 'date', 'branch', 'tags', 'transplant')    def create(repo, target=None, style=None, custom=None, **kargs):   return Factory(repo, custom, style, target, **kargs)() @@ -191,7 +192,8 @@
  'revid': _('Revision:'), 'summary': _('Summary:'),   'user': _('User:'), 'age': _('Age:'), 'date': _('Date:'),   'branch': _('Branch:'), 'tags': _('Tags:'), - 'rawbranch': _('Branch:'), 'rawtags': _('Tags:')} + 'rawbranch': _('Branch:'), 'rawtags': _('Tags:'), + 'transplant': _('Transplant:')}     def __init__(self):   pass @@ -257,6 +259,15 @@
  if len(value) == 0:   return None   return value + elif item == 'transplant': + extra = ctx.extra() + try: + ts = extra['transplant_source'] + if ts: + return binascii.hexlify(ts) + except KeyError: + pass + return None   elif item == 'ishead':   return len(ctx.children()) == 0   raise UnknownItem(item) @@ -300,7 +311,7 @@
  revnum, revid = value   revid = gtklib.markup(revid, **mono)   return '%s (%s)' % (revnum, revid) - elif item == 'revid': + elif item in ('revid', 'transplant'):   return gtklib.markup(value, **mono)   elif item == 'revnum':   return str(value) @@ -334,7 +345,7 @@
  SummaryInfo.__init__(self)   self.cache = {}   - def try_cache(self, target, func, *args): + def try_cache(self, target, func, *args, **kargs):   item, widget, ctx, custom = args   root = ctx._repo.root   repoid = id(ctx._repo) @@ -357,17 +368,17 @@
  return cacheinfo[1][key]   except KeyError:   pass - cacheinfo[1][key] = func(self, *args) + cacheinfo[1][key] = func(self, *args, **kargs)   return cacheinfo[1][key]   - def get_data(self, *args): - return self.try_cache('data', SummaryInfo.get_data, *args) + def get_data(self, *args, **kargs): + return self.try_cache('data', SummaryInfo.get_data, *args, **kargs)   - def get_label(self, *args): - return self.try_cache('label', SummaryInfo.get_label, *args) + def get_label(self, *args, **kargs): + return self.try_cache('label', SummaryInfo.get_label, *args, **kargs)   - def get_markup(self, *args): - return self.try_cache('markup', SummaryInfo.get_markup, *args) + def get_markup(self, *args, **kargs): + return self.try_cache('markup', SummaryInfo.get_markup, *args, **kargs)     def clear_cache(self):   self.cache = {}