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

status: add types argument to getChecked()

Allow users to request checked files of certain types

Changeset 81e2e372dbbc

Parent 5874d009504c

by Steve Borho

Changes to one file · Browse files at 81e2e372dbbc Showing diff from parent 5874d009504c Diff from another changeset...

 
263
264
265
266
267
268
269
 
 
 
 
 
 
 
 
 
 
 
 
 
270
271
272
 
615
616
617
 
 
 
 
618
619
620
 
263
264
265
 
 
 
 
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
 
624
625
626
627
628
629
630
631
632
633
@@ -263,10 +263,19 @@
  def isMerge(self):   return bool(self.wctx.p2())   - def getChecked(self): - if self.tv.model(): - checked = self.tv.model().getChecked() - return [f for f, v in checked.iteritems() if v] + def getChecked(self, types=None): + model = self.tv.model() + if model: + checked = model.getChecked() + if types is None: + return [f for f, v in checked.iteritems() if v] + else: + files = [] + for row in model.getAllRows(): + path, status, mst, upath, ext, sz = row + if status in types and checked[path]: + files.append(path) + return files   else:   return []   @@ -615,6 +624,10 @@
  assert index.isValid()   return self.rows[index.row()]   + def getAllRows(self): + for row in self.rows: + yield row +   def toggleRow(self, index):   'Connected to "activated" signal, emitted by dbl-click or enter'   assert index.isValid()