Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0.3, 2.0.4, and 2.0.5

stable quickop: add ability to delete unversioned files (fixes #269)

Changeset 8fac583b0e42

Parent 9153ea58dc53

by Steve Borho

Changes to one file · Browse files at 8fac583b0e42 Showing diff from parent 9153ea58dc53 Diff from another changeset...

 
8
9
10
 
 
 
 
 
 
11
12
13
14
15
16
17
18
19
20
21
 
128
129
130
131
132
133
 
134
135
136
137
138
139
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
141
142
 
8
9
10
11
12
13
14
15
16
17
18
19
 
 
 
 
 
20
21
22
 
129
130
131
 
 
 
132
133
134
135
136
 
 
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
@@ -8,14 +8,15 @@
 import os  import sys   +from mercurial import util + +from tortoisehg.util import hglib, shlib +from tortoisehg.hgqt.i18n import _ +from tortoisehg.hgqt import qtlib, status, cmdui +  from PyQt4.QtCore import *  from PyQt4.QtGui import *   -from tortoisehg.hgqt.i18n import _ -from tortoisehg.util import hglib, shlib - -from tortoisehg.hgqt import qtlib, status, cmdui -  LABELS = { 'add': (_('Checkmark files to add'), _('Add')),   'forget': (_('Checkmark files to forget'), _('Forget')),   'revert': (_('Checkmark files to revert'), _('Revert')), @@ -128,15 +129,26 @@
  if hasattr(self, 'chk') and self.chk.isChecked():   cmdline.append('--no-backup')   files = self.stwidget.getChecked() - if files: - cmdline.extend(files) - else: + if not files:   qtlib.WarningMsgBox(_('No files selected'),   _('No operation to perform'),   parent=self)   return - self.files = files - self.cmd.run(cmdline) + if self.command == 'remove': + wctx = self.repo[None] + for wfile in files: + if wfile not in wctx: + try: + util.unlink(wfile) + except EnvironmentError: + pass + files.remove(wfile) + if files: + cmdline.extend(files) + self.files = files + self.cmd.run(cmdline) + else: + self.reject()     def reject(self):   if self.cmd.core.running():