Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.6, 0.7, and 0.7.1

status: allow files to be copied to other directory

Changeset 91064a2f2b0f

Parent ff376f53315b

by TK Soh

Changes to one file · Browse files at 91064a2f2b0f Showing diff from parent ff376f53315b Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​status.py Stacked
 
545
546
547
 
548
549
550
551
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
552
553
554
 
545
546
547
548
549
 
 
 
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
@@ -545,10 +545,23 @@
      def _copy_file(self, stat, file): + file = self.repo.wjoin(file)   fdir, fname = os.path.split(file) - newfile = entry_dialog(self, "Copy file to:", True, fname) - if newfile and newfile != fname: - self._hg_copy([file, os.path.join(fdir, newfile)]) + dialog = gtk.FileChooserDialog(parent=self, + title='Copy file to', + action=gtk.FILE_CHOOSER_ACTION_SAVE, + buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL, + gtk.STOCK_COPY,gtk.RESPONSE_OK)) + dialog.set_default_response(gtk.RESPONSE_OK) + dialog.set_current_folder(fdir) + dialog.set_current_name(fname) + response = dialog.run() + newfile=file + if response == gtk.RESPONSE_OK: + newfile = dialog.get_filename() + dialog.destroy() + if newfile != file: + self._hg_copy([file, newfile])   return True