Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1, 2.1.1, and 2.1.2

Merge with stable

Changeset 29f088531f12

Parents 2975e8e472f1

Parents 4df9d3b22a66

by Steve Borho

Changes to 3 files · Browse files at 29f088531f12 Showing diff from parent 2975e8e472f1 4df9d3b22a66 Diff from another changeset...

 
275
276
277
 
278
279
280
 
275
276
277
278
279
280
281
@@ -275,6 +275,7 @@
  self.split.setSizePolicy(sp)   # Add our widgets to the top of our splitter   self.split.addWidget(upperframe) + self.split.setCollapsible(0, False)   # Add status widget document frame below our splitter   # this reparents the docf from the status splitter   self.split.addWidget(self.stwidget.docf)
 
84
85
86
87
 
88
89
90
 
92
93
94
95
96
97
98
99
100
 
106
107
108
109
 
110
111
112
 
116
117
118
119
 
 
 
 
120
121
122
 
163
164
165
 
 
 
 
166
167
 
168
169
170
 
172
173
174
175
176
177
 
 
178
179
180
 
 
 
 
 
 
 
181
182
183
 
196
197
198
199
 
 
200
201
202
 
205
206
207
208
209
 
 
 
 
 
 
 
 
 
 
210
211
212
 
84
85
86
 
87
88
89
90
 
92
93
94
 
 
 
95
96
97
 
103
104
105
 
106
107
108
109
 
113
114
115
 
116
117
118
119
120
121
122
 
163
164
165
166
167
168
169
170
171
172
173
174
175
 
177
178
179
 
 
 
180
181
182
 
 
183
184
185
186
187
188
189
190
191
192
 
205
206
207
 
208
209
210
211
212
 
215
216
217
 
 
218
219
220
221
222
223
224
225
226
227
228
229
230
@@ -84,7 +84,7 @@
  copycheck.setToolTip(_('Uncheck to consider all revisioned files '   'for copy sources'))   copycheck.setChecked(True) - findrenames = QPushButton(_('Find Rename')) + findrenames = QPushButton(_('Find Renames'))   findrenames.setToolTip(_('Find copy and/or rename sources'))   findrenames.setEnabled(False)   findrenames.clicked.connect(self.findRenames) @@ -92,9 +92,6 @@
  buthbox.addStretch(1)   buthbox.addWidget(findrenames)   self.findbtn, self.copycheck = findrenames, copycheck - def itemselect(): - self.findbtn.setEnabled(len(self.unrevlist.selectedItems())) - self.unrevlist.itemSelectionChanged.connect(itemselect)     matchlbl = QLabel(_('<b>Candidate Matches</b>'))   matchvbox.addWidget(matchlbl) @@ -106,7 +103,7 @@
  matchtv.setSortingEnabled(True)   matchtv.selectionModel().selectionChanged.connect(self.showDiff)   buthbox = QHBoxLayout() - matchbtn = QPushButton(_('Accept Selected Matches')) + matchbtn = QPushButton(_('Accept All Matches'))   matchbtn.clicked.connect(self.acceptMatch)   matchbtn.setEnabled(False)   buthbox.addStretch(1) @@ -116,7 +113,10 @@
  self.matchtv, self.matchbtn = matchtv, matchbtn   def matchselect(s, d):   count = len(matchtv.selectedIndexes()) - self.matchbtn.setEnabled(count > 0) + if count: + self.matchbtn.setText(_('Accept Selected Matches')) + else: + self.matchbtn.setText(_('Accept All Matches'))   selmodel = matchtv.selectionModel()   selmodel.selectionChanged.connect(matchselect)   @@ -163,8 +163,13 @@
  item.orig = x   self.unrevlist.addItem(item)   self.unrevlist.setItemSelected(item, x in self.pats) + if dests: + self.findbtn.setEnabled(True) + else: + self.findbtn.setEnabled(False)   self.difftb.clear()   self.pats = [] + self.matchbtn.setEnabled(len(self.matchtv.model().rows))     def findRenames(self):   'User pressed "find renames" button' @@ -172,12 +177,16 @@
  QMessageBox.information(self, _('Search already in progress'),   _('Cannot start a new search'))   return - ulist = [] - for item in self.unrevlist.selectedItems(): - ulist.append(item.orig) + + ulist = [it.orig for it in self.unrevlist.selectedItems()]   if not ulist: - QMessageBox.information(self, _('No rows selected'), - _('Select one or more rows for search')) + # When no files are selected, look for all files + ulist = [self.unrevlist.item(n).orig + for n in range(self.unrevlist.count())] + + if not ulist: + QMessageBox.information(self, _('No files to find'), + _('There are no files that may have been renamed'))   return     pct = self.simslider.value() / 100.0 @@ -196,7 +205,8 @@
  self.stbar.clear()   for col in xrange(3):   self.matchtv.resizeColumnToContents(col) - self.findbtn.setEnabled(len(self.unrevlist.selectedItems())) + self.findbtn.setEnabled(self.unrevlist.count()) + self.matchbtn.setEnabled(len(self.matchtv.model().rows))     def rowReceived(self, args):   self.matchtv.model().appendRow(*args) @@ -205,8 +215,16 @@
  'User pressed "accept match" button'   remdests = {}   wctx = self.repo[None] - for index in self.matchtv.selectionModel().selectedRows(): - src, dest, percent = self.matchtv.model().getRow(index) + m = self.matchtv.model() + + # If no rows are selected, ask the user if he'd like to accept all renames + if self.matchtv.selectionModel().hasSelection(): + itemList = [row for row in self.matchtv.selectionModel().selectedRows()] + else: + itemList = m.rows + + for item in itemList: + src, dest, percent = item   if dest in remdests:   udest = hglib.tounicode(dest)   QMessageBox.warning(self, _('Multiple sources chosen'),
 
178
179
180
181
182
183
 
 
184
185
186
 
189
190
191
192
193
 
194
195
196
 
178
179
180
 
 
 
181
182
183
184
185
 
188
189
190
 
 
191
192
193
194
@@ -178,9 +178,8 @@
  filter=_FILE_FILTER)   if filelist:   # Qt file browser uses '/' in paths, even on Windows. - filelist = [str(x.replace('/', os.sep)) for x in filelist] - response = os.pathsep.join(filelist) - self.src_combo.setEditText(response) + nl = QStringList([QDir.toNativeSeparators(x) for x in filelist]) + self.src_combo.setEditText(nl.join(os.pathsep))   self.src_combo.setFocus()     def browsedir(self): @@ -189,8 +188,7 @@
  directory=self.repo.root,   caption=caption)   if path: - response = str(path.replace('/', os.sep)) - self.src_combo.setEditText(response) + self.src_combo.setEditText(QDir.toNativeSeparators(path))   self.src_combo.setFocus()     def getcliptext(self):