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

status: add file context menu to copy clean files

Changeset d3e3f85b3226

Parent 7335932c6d07

by TK Soh

Changes to one file · Browse files at d3e3f85b3226 Showing diff from parent 7335932c6d07 Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​status.py Stacked
 
81
82
83
 
84
85
86
 
543
544
545
 
 
 
 
 
 
 
 
546
547
548
 
576
577
578
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
579
580
581
 
81
82
83
84
85
86
87
 
544
545
546
547
548
549
550
551
552
553
554
555
556
557
 
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
@@ -81,6 +81,7 @@
  (('_view', self._view_file),   ('re_move', self._remove_file),   ('re_name', self._rename_file), + ('_copy', self._copy_file),   ('l_og', self._log_file)),   # ignored   (('_view', self._view_file), @@ -543,6 +544,14 @@
  return True     + def _copy_file(self, stat, 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)]) + return True + +   def _hg_remove(self, files):   wfiles = [self.repo.wjoin(x) for x in files]   if self.count_revs() > 1: @@ -576,6 +585,23 @@
  self.reload_status()     + def _hg_copy(self, files): + wfiles = [self.repo.wjoin(x) for x in files] + if self.count_revs() > 1: + Prompt('Nothing Copied', 'Copy is not enabled when ' + 'multiple revisions are specified.', self).run() + return + + # Create new opts, so nothing unintented gets through + cmdopts = self.merge_opts(commands.table['copy|cp'][1], + ('include', 'exclude')) + def dohgcopy(): + commands.copy(self.ui, self.repo, *wfiles, **cmdopts) + success, outtext = self._hg_call_wrapper('Copy', dohgcopy) + if success: + self.reload_status() + +   def _tree_selection_changed(self, selection, force):   ''' Update the diff text '''   def dohgdiff():