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

fogcreek quickop: support adding files as kbfiles

Changeset 7558ebba2139

Parent 5a6f30401e32

by David Golub

Changes to one file · Browse files at 7558ebba2139 Showing diff from parent 5a6f30401e32 Diff from another changeset...

 
13
14
15
 
16
17
18
 
96
97
98
 
 
 
 
 
99
100
101
 
136
137
138
139
140
141
 
 
 
142
143
144
 
167
168
169
 
 
 
 
 
 
 
 
 
 
 
170
171
172
 
13
14
15
16
17
18
19
 
97
98
99
100
101
102
103
104
105
106
107
 
142
143
144
 
 
 
145
146
147
148
149
150
 
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
@@ -13,6 +13,7 @@
 from tortoisehg.util import hglib, shlib  from tortoisehg.hgqt.i18n import _  from tortoisehg.hgqt import qtlib, status, cmdui +from tortoisehg.hgqt import settings    from PyQt4.QtCore import *  from PyQt4.QtGui import * @@ -96,6 +97,11 @@
  bb.button(BB.Ok).setText(LABELS[command][1])   layout.addWidget(bb)   self.bb = bb + + if self.command == 'add' and settings.hasExtension('kbfiles'): + self.addBfilesButton = QPushButton(_("Add &Bfiles")) + self.addBfilesButton.clicked.connect(self.addBfiles) + bb.addButton(self.addBfilesButton, BB.ActionRole)     hbox = QHBoxLayout()   hbox.setMargin(0) @@ -136,9 +142,9 @@
  parent=self)   return   if self.command == 'remove': - self.repo.bfstatus = True - repostate = self.repo.status() - self.repo.bfstatus = False + self.repo.bfstatus = True + repostate = self.repo.status() + self.repo.bfstatus = False   unknown, ignored = repostate[4:6]   for wfile in files:   if wfile in unknown or wfile in ignored: @@ -167,6 +173,17 @@
  s.setValue('quickop/nobackup', self.chk.isChecked())   QDialog.reject(self)   + def addBfiles(self): + cmdline = ['add', '--bf'] + files = self.stwidget.getChecked() + if not files: + qtlib.WarningMsgBox(_('No files selected'), + _('No operation to perform'), + parent=self) + return + cmdline.extend(files) + self.files = files + self.cmd.run(cmdline)    instance = None  class HeadlessQuickop(QWidget):