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

mq: use mq.active() instead of the lower level mq.active_guards()

active() behaves much like a propertycache

Changeset 655b3f0b1696

Parent 7c2643a5d431

by Steve Borho

Changes to one file · Browse files at 655b3f0b1696 Showing diff from parent 7c2643a5d431 Diff from another changeset...

 
410
411
412
413
414
415
416
 
439
440
441
442
 
443
444
445
 
550
551
552
553
 
554
555
556
 
558
559
560
561
 
562
563
564
565
566
567
568
 
569
570
571
 
410
411
412
 
413
414
415
 
438
439
440
 
441
442
443
444
 
549
550
551
 
552
553
554
555
 
557
558
559
 
560
561
562
563
564
565
566
 
567
568
569
570
@@ -410,7 +410,6 @@
  # TODO: maintain current selection   applied = set([p.name for p in repo.mq.applied])   self.allguards = set() - self.activeguards = repo.mq.active_guards or []   items = []   for idx, patch in enumerate(repo.mq.series):   item = QListWidgetItem(hglib.tounicode(patch)) @@ -439,7 +438,7 @@
  for item in reversed(items):   self.queueListWidget.addItem(item)   - for guard in self.activeguards: + for guard in repo.mq.active():   self.allguards.add(guard)   self.refreshSelectedGuards()   @@ -550,7 +549,7 @@
    def refreshSelectedGuards(self):   total = len(self.allguards) - count = len(self.activeguards) + count = len(self.repo.mq.active())   oldmenu = self.guardSelBtn.menu()   if oldmenu:   oldmenu.setParent(None) @@ -558,14 +557,14 @@
  for guard in self.allguards:   a = menu.addAction(hglib.tounicode(guard))   a.setCheckable(True) - a.setChecked(guard in self.activeguards) + a.setChecked(guard in self.repo.mq.active())   a.triggered.connect(self.onGuardSelectionChange)   self.guardSelBtn.setMenu(menu)   self.guardSelBtn.setText(_('Guards: %d/%d') % (count, total))     def onGuardSelectionChange(self, isChecked):   guard = hglib.fromunicode(self.sender().text()) - newguards = self.activeguards[:] + newguards = self.repo.mq.active()[:]   if isChecked:   newguards.append(guard)   elif guard in newguards: