Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

status: moving bits around, no behavior change

Changeset da1fbb20c0f1

Parent 3924b085e482

by Steve Borho

Changes to one file · Browse files at da1fbb20c0f1 Showing diff from parent 3924b085e482 Diff from another changeset...

 
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
 
90
91
92
93
 
94
95
96
 
342
343
344
345
346
347
348
349
350
351
352
353
354
355
 
417
418
419
420
 
421
422
 
423
424
425
 
467
468
469
 
470
471
472
 
485
486
487
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
488
489
 
40
41
42
 
 
 
 
 
 
 
43
44
45
46
47
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
50
51
52
 
71
72
73
 
74
75
76
77
 
323
324
325
 
 
 
 
 
 
 
 
326
327
328
 
390
391
392
 
393
394
 
395
396
397
398
 
440
441
442
443
444
445
446
 
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
@@ -40,32 +40,13 @@
 # Toolbar  # double-click visual diffs   -class StatusType(object): - preferredOrder = 'MAR?!ICS' - def __init__(self, name, icon, desc, uilabel): - self.name = name - self.icon = icon - self.desc = desc - self.uilabel = uilabel +COL_CHECK = 0 +COL_STATUS = 1 +COL_MERGE_STATE = 2 +COL_PATH_DISPLAY = 3 +COL_PATH = 4   -statusTypes = { - 'M' : StatusType('modified', 'menucommit.ico', _('%s is modified'), - 'status.modified'), - 'A' : StatusType('added', 'fileadd.ico', _('%s is added'), - 'status.added'), - 'R' : StatusType('removed', 'filedelete.ico', _('%s is removed'), - 'status.removed'), - '?' : StatusType('unknown', 'shelve.ico', _('%s is not tracked (unknown)'), - 'status.unknown'), - '!' : StatusType('deleted', 'menudelete.ico', _('%s is missing!'), - 'status.deleted'), - 'I' : StatusType('ignored', 'ignore.ico', _('%s is ignored'), - 'status.ignored'), - 'C' : StatusType('clean', '', _('%s is not modified (clean)'), - 'status.clean'), - 'S' : StatusType('subrepo', 'hg.ico', _('%s is a dirty subrepo'), - 'status.subrepo'), -} +_colors = {}    class StatusWidget(QWidget):   def __init__(self, pats, opts, parent=None): @@ -90,7 +71,7 @@
  effect = qtlib.geteffect(label)   for e in effect.split(';'):   if e.startswith('color:'): - colors[stat] = QColor(e[7:]) + _colors[stat] = QColor(e[7:])   break     split = QSplitter(Qt.Horizontal) @@ -342,14 +323,6 @@
  def selectedRows(self):   return self.selectionModel().selectedRows()   -COL_CHECK = 0 -COL_STATUS = 1 -COL_MERGE_STATE = 2 -COL_PATH_DISPLAY = 3 -COL_PATH = 4 - -colors = {} -  class WctxModel(QAbstractTableModel):   def __init__(self, wctx, ms, opts, parent=None):   QAbstractTableModel.__init__(self, parent) @@ -417,9 +390,9 @@
  checked, status, mst, upath, path = self.rows[index.row()]   if role == Qt.TextColorRole:   if mst: - return colors.get(mst.lower(), QColor('black')) + return _colors.get(mst.lower(), QColor('black'))   else: - return colors.get(status, QColor('black')) + return _colors.get(status, QColor('black'))   elif role == Qt.ToolTipRole:   if status in statusTypes:   tip = statusTypes[status].desc % upath @@ -467,6 +440,7 @@
  if index.column() == COL_CHECK:   self.toggleRow(index)   +  class WctxProxyModel(QSortFilterProxyModel):   def __init__(self, parent=None):   QSortFilterProxyModel.__init__(self, parent) @@ -485,5 +459,32 @@
  index = self.mapToSource(index)   return self.sourceModel().pressedRow(index)   +class StatusType(object): + preferredOrder = 'MAR?!ICS' + def __init__(self, name, icon, desc, uilabel): + self.name = name + self.icon = icon + self.desc = desc + self.uilabel = uilabel + +statusTypes = { + 'M' : StatusType('modified', 'menucommit.ico', _('%s is modified'), + 'status.modified'), + 'A' : StatusType('added', 'fileadd.ico', _('%s is added'), + 'status.added'), + 'R' : StatusType('removed', 'filedelete.ico', _('%s is removed'), + 'status.removed'), + '?' : StatusType('unknown', 'shelve.ico', _('%s is not tracked (unknown)'), + 'status.unknown'), + '!' : StatusType('deleted', 'menudelete.ico', _('%s is missing!'), + 'status.deleted'), + 'I' : StatusType('ignored', 'ignore.ico', _('%s is ignored'), + 'status.ignored'), + 'C' : StatusType('clean', '', _('%s is not modified (clean)'), + 'status.clean'), + 'S' : StatusType('subrepo', 'hg.ico', _('%s is a dirty subrepo'), + 'status.subrepo'), +} +  def run(ui, *pats, **opts):   return StatusWidget(pats, opts)