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

stable archive: fix bad handling of non-ascii path (refs #883)

- don't set local str to Qt widget
- remove double conversions to local str at compose_command()
- remove extra encoding conversion

Changeset 3da9cd70deb4

Parent 3d43a37b08d3

by Yuya Nishihara

Changes to one file · Browse files at 3da9cd70deb4 Showing diff from parent 3d43a37b08d3 Diff from another changeset...

 
141
142
143
144
 
145
146
147
 
185
186
187
188
 
189
190
191
 
249
250
251
252
 
253
254
255
 
265
266
267
268
 
269
270
271
 
276
277
278
279
 
280
281
282
 
283
284
285
286
287
 
288
289
290
 
301
302
303
304
305
 
 
306
307
308
309
310
311
 
312
313
314
 
336
337
338
339
 
340
341
342
 
141
142
143
 
144
145
146
147
 
185
186
187
 
188
189
190
191
 
249
250
251
 
252
253
254
255
 
265
266
267
 
268
269
270
271
 
276
277
278
 
279
280
281
 
282
283
284
285
286
 
287
288
289
290
 
301
302
303
 
 
304
305
306
307
308
309
310
 
311
312
313
314
 
336
337
338
 
339
340
341
342
@@ -141,7 +141,7 @@
  self.rev_combo.setMaxVisibleItems(self.rev_combo.count())   self.rev_combo.setCurrentIndex(0)   self.subrepos_chk.setChecked(self.get_subrepos_present()) - self.dest_edit.setText(self.repo.root) + self.dest_edit.setText(hglib.tounicode(self.repo.root))   self.filesradio.setChecked(True)   self.update_path()   @@ -185,7 +185,7 @@
    def browse_clicked(self):   """Select the destination directory or file""" - dest = hglib.fromunicode(self.dest_edit.text()) + dest = unicode(self.dest_edit.text())   if not os.path.exists(dest):   dest = os.path.dirname(dest)   select = self.get_selected_archive_type() @@ -249,7 +249,7 @@
  def remove_rev(path):   l = ''   for i in xrange(self.rev_combo.count() - 1): - l += hglib.fromunicode(self.rev_combo.itemText(i)) + l += unicode(self.rev_combo.itemText(i))   revs = [rev[0] for rev in l]   revs.append(wdrev)   if not self.prevtarget is None: @@ -265,7 +265,7 @@
  if select['type'] != 'files':   path += select['ext']   return path - text = self.rev_combo.currentText() + text = unicode(self.rev_combo.currentText())   if len(text) == 0:   return   wdrev = str(self.repo['.'].rev()) @@ -276,15 +276,15 @@
  self.repo[hglib.fromunicode(text)]   except (error.RepoError, error.LookupError):   return - path = hglib.fromunicode(self.dest_edit.text()) + path = unicode(self.dest_edit.text())   path = remove_ext(path)   path = remove_rev(path) - path = add_rev(path, hglib.fromunicode(text)) + path = add_rev(path, text)   path = add_ext(path)   self.dest_edit.setText(path)   self.prevtarget = text   type = self.get_selected_archive_type()['type'] - self.compose_command(path, type) + self.compose_command(hglib.fromunicode(path), type)     def compose_command(self, dest, type):   cmdline = ['archive', '--repository', self.repo.root] @@ -301,14 +301,14 @@
  cmdline.append('-I')   cmdline.append(f)   cmdline.append('--') - cmdline.append(hglib.fromunicode(dest)) - self.hgcmd_txt.setText('hg ' + ' '.join(cmdline)) + cmdline.append(dest) # dest: local str + self.hgcmd_txt.setText(hglib.tounicode('hg ' + ' '.join(cmdline)))   return cmdline     def archive(self):   # verify input   type = self.get_selected_archive_type()['type'] - dest = self.dest_edit.text() + dest = unicode(self.dest_edit.text())   if os.path.exists(dest):   if type == 'files':   if os.path.isfile(dest): @@ -336,7 +336,7 @@
  return False     # prepare command line - cmdline = self.compose_command(dest, type) + cmdline = self.compose_command(hglib.fromunicode(dest), type)     if self.files_in_rev_chk.isChecked():   self.savedcwd = os.getcwd()