48
48
showMessage = pyqtSignal(unicode)
49
49
fileDisplayed = pyqtSignal(QString, QString)
51
def __init__(self, repo, pats, opts, parent=None, checkable=True):
51
def __init__(self, repo, pats, opts, parent=None, checkable=True,
52
53
QWidget.__init__(self, parent)
54
55
self.opts = dict(modified=True, added=True, removed=True, deleted=True,
131
133
self.filelistToolbar.addWidget(self.statusfilter)
132
134
self.filelistToolbar.addSeparator()
133
135
self.filelistToolbar.addWidget(self.refreshBtn)
134
self.actions = wctxactions.WctxActions(self.repo, self)
136
self.actions = wctxactions.WctxActions(self.repo, self, checkable)
135
137
tv = WctxFileTree(self.repo, checkable=checkable)
136
138
vbox.addLayout(hbox)
137
139
vbox.addWidget(tv)
286
288
ms = merge.mergestate(self.repo)
287
289
tm = WctxModel(wctx, ms, self.pctx, self.savechecks, self.opts,
288
checked, self, checkable=self.checkable)
290
checked, self, checkable=self.checkable,
291
defcheck=self.defcheck)
289
292
if self.checkable:
290
293
tm.checkToggled.connect(self.updateCheckCount)
416
419
def __init__(self, repo, pctx, pats, opts, parent=None):
417
420
super(StatusThread, self).__init__()
418
self.repo = thgrepo.repository(repo.ui, repo.root)
421
self.repo = hg.repository(repo.ui, repo.root)
550
553
class WctxModel(QAbstractTableModel):
551
554
checkToggled = pyqtSignal()
553
def __init__(self, wctx, ms, pctx, savechecks, opts, checked, parent, checkable=True):
556
def __init__(self, wctx, ms, pctx, savechecks, opts, checked, parent,
557
checkable=True, defcheck='MAR!S'):
554
558
QAbstractTableModel.__init__(self, parent)
555
559
self.checkCount = 0
577
581
pctxmatch = lambda f: True
578
582
if opts['modified']:
579
583
for m in wctx.modified():
580
nchecked[m] = checked.get(m, m not in excludes and pctxmatch(m))
584
nchecked[m] = checked.get(m, 'M' in defcheck and
585
m not in excludes and pctxmatch(m))
581
586
rows.append(mkrow(m, 'M'))
582
587
if opts['added']:
583
588
for a in wctx.added():
584
nchecked[a] = checked.get(a, a not in excludes and pctxmatch(a))
589
nchecked[a] = checked.get(a, 'A' in defcheck and
590
a not in excludes and pctxmatch(a))
585
591
rows.append(mkrow(a, 'A'))
586
592
if opts['removed']:
587
593
for r in wctx.removed():
588
nchecked[r] = checked.get(r, r not in excludes and pctxmatch(r))
594
nchecked[r] = checked.get(r, 'R' in defcheck and
595
r not in excludes and pctxmatch(r))
589
596
rows.append(mkrow(r, 'R'))
590
597
if opts['deleted']:
591
598
for d in wctx.deleted():
592
nchecked[d] = checked.get(d, d not in excludes and pctxmatch(d))
599
nchecked[d] = checked.get(d, 'D' in defcheck and
600
d not in excludes and pctxmatch(d))
593
601
rows.append(mkrow(d, '!'))
594
602
if opts['unknown']:
595
603
for u in wctx.unknown() or []:
596
nchecked[u] = checked.get(u, False)
604
nchecked[u] = checked.get(u, '?' in defcheck)
597
605
rows.append(mkrow(u, '?'))
598
606
if opts['ignored']:
599
607
for i in wctx.ignored() or []:
600
nchecked[i] = checked.get(i, False)
608
nchecked[i] = checked.get(i, 'I' in defcheck)
601
609
rows.append(mkrow(i, 'I'))
602
610
if opts['clean']:
603
611
for c in wctx.clean() or []:
604
nchecked[c] = checked.get(c, False)
612
nchecked[c] = checked.get(c, 'C' in defcheck)
605
613
rows.append(mkrow(c, 'C'))
606
614
if opts['subrepo']:
607
615
for s in wctx.dirtySubrepos:
608
nchecked[s] = checked.get(s, True)
616
nchecked[s] = checked.get(s, 'S' in defcheck)
609
617
rows.append(mkrow(s, 'S'))
610
618
# include clean unresolved files