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

guess: remove all rows with rename dest matches

i.e.: if it lists three possible rename candidate matches and the user
accepts one of them, remove all three from the list.

Changeset 4bfdada47d99

Parent 74acceb9d9e7

by Steve Borho

Changes to one file · Browse files at 4bfdada47d99 Showing diff from parent 74acceb9d9e7 Diff from another changeset...

 
229
230
231
 
232
233
234
 
236
237
238
239
240
241
242
 
 
 
243
244
245
 
344
345
346
 
 
 
 
 
 
 
 
 
 
 
347
348
349
 
229
230
231
232
233
234
235
 
237
238
239
 
 
 
 
240
241
242
243
244
245
 
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
@@ -229,6 +229,7 @@
  def acceptMatch(self):   'User pressed "accept match" button'   hglib.invalidaterepo(self.repo) + remdests = []   for index in self.matchlv.selectedIndexes():   src, dest, percent = self.matchlv.model().getRow(index)   if not os.path.exists(self.repo.wjoin(src)): @@ -236,10 +237,9 @@
  self.repo.remove([src])   self.repo.copy(src, dest)   shlib.shell_notify([self.repo.wjoin(src), self.repo.wjoin(dest)]) - # Mark all rows with this target file as non-sensitive - #for row in self.matchlv.model().getRows(): - # if row[1] == dest: - # row[5] = False + remdests.append(dest) + for dest in remdests: + self.matchlv.model().remove(dest)   self.matchAccepted.emit()   self.refresh()   @@ -344,6 +344,17 @@
  self.endRemoveRows()   self.emit(SIGNAL("dataChanged()"))   + def remove(self, dest): + i = 0 + while i < len(self.rows): + if self.rows[i][1] == dest: + self.beginRemoveRows(QModelIndex(), i, i) + self.rows.pop(i) + self.endRemoveRows() + else: + i += 1 + self.emit(SIGNAL("dataChanged()")) +   def sort(self, col, order):   self.emit(SIGNAL("layoutAboutToBeChanged()"))   if col == COL_PATH: