Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

thgmq: add & rename public methods

Changeset cbe009b2220f

Parent 5dc5132e4d41

by Yuki KODAMA

Changes to one file · Browse files at cbe009b2220f Showing diff from parent 5dc5132e4d41 Diff from another changeset...

 
497
498
499
500
501
502
503
 
 
504
505
506
 
 
 
 
507
508
509
 
 
510
511
 
512
513
514
 
629
630
631
632
 
633
634
635
 
497
498
499
 
 
 
 
500
501
502
503
504
505
506
507
508
509
 
 
510
511
512
 
513
514
515
516
 
631
632
633
 
634
635
636
637
@@ -497,18 +497,20 @@
  return self.mqloaded and os.path.isdir(self.repo.mq.path)     def has_patch(self): - """ return True if MQ has applicable patch """ - if self.mqloaded: - return len(self.repo.mq.series) > 0 - return False + """ return True if MQ has applicable patches """ + return bool(self.get_num_patches())     def has_applied(self):   """ return True if MQ has applied patches """ + return bool(self.get_num_applied()) + + def get_num_patches(self): + """ return the number of patches in patch queue """   if self.mqloaded: - return len(self.repo.mq.applied) > 0 - return False + return len(self.repo.mq.series) + return 0   - def number_applied(self): + def get_num_applied(self):   """ return the number of applied patches """   if self.mqloaded:   return len(self.repo.mq.applied) @@ -629,7 +631,7 @@
  is_qtip = self.is_qtip(row[MQ_NAME])   is_qparent = row[MQ_INDEX] == INDEX_QPARENT   is_applied = row[MQ_STATUS] == 'A' - is_next = row[MQ_INDEX] == self.number_applied() + is_next = row[MQ_INDEX] == self.get_num_applied()     if is_operable and not is_qtip and (not is_qparent or has_applied):   append(_('_Goto'), self.goto_activated)