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

Merge with stable

Changeset cc9fafc69176

Parents c19873efd8d5

Parents 17025c560486

by Steve Borho

Changes to 12 files · Browse files at cc9fafc69176 Showing diff from parent c19873efd8d5 17025c560486 Diff from another changeset...

 
7
8
9
10
 
11
12
13
 
55
56
57
58
59
60
61
 
114
115
116
117
 
118
 
119
120
121
 
196
197
198
 
 
199
200
201
 
436
437
438
 
 
 
 
439
440
441
 
451
452
453
454
 
455
456
457
 
7
8
9
 
10
11
12
13
 
55
56
57
 
58
59
60
 
113
114
115
 
116
117
118
119
120
121
 
196
197
198
199
200
201
202
203
 
438
439
440
441
442
443
444
445
446
447
 
457
458
459
 
460
461
462
463
@@ -7,7 +7,7 @@
 # This software may be used and distributed according to the terms of the  # GNU General Public License version 2, incorporated herein by reference.   -import os, string +import os    from PyQt4.QtCore import *  from PyQt4.QtGui import * @@ -55,7 +55,6 @@
  self.src_combo = QComboBox()   self.src_combo.setEditable(True)   self.src_combo.setMinimumWidth(310) - self.src_combo.lineEdit().returnPressed.connect(self.clone)   self.src_btn = QPushButton(_('Browse...'))   self.src_btn.setAutoDefault(False)   self.src_btn.clicked.connect(self.browse_src) @@ -114,8 +113,9 @@
  if btnlabel:   btn = QPushButton(btnlabel)   btn.setEnabled(False) - btn.setAutoDefault = False + btn.setAutoDefault(False)   btn.clicked.connect(btnslot) + hbox.addSpacing(6)   hbox.addWidget(btn)   chk.toggled.connect(   lambda e: self.toggle_enabled(e, text, target2=btn)) @@ -196,6 +196,8 @@
  # connect extra signals   self.src_combo.editTextChanged.connect(self.composeCommand)   self.src_combo.editTextChanged.connect(self.onUrlHttps) + self.src_combo.editTextChanged.connect(self.onResetDefault) + self.src_combo.currentIndexChanged.connect(self.onResetDefault)   self.dest_combo.editTextChanged.connect(self.composeCommand)   self.rev_chk.toggled.connect(self.composeCommand)   self.rev_text.textChanged.connect(self.composeCommand) @@ -436,6 +438,10 @@
  self.qclone_txt.setFocus()   self.composeCommand()   + @pyqtSlot(QString) + def onResetDefault(self, text): + self.clone_btn.setDefault(True) +   def command_started(self):   self.cmd.setShown(True)   self.clone_btn.setHidden(True) @@ -451,7 +457,7 @@
  self.detail_btn.setChecked(True)   self.clone_btn.setShown(True)   self.close_btn.setShown(True) - self.close_btn.setAutoDefault(True) + self.close_btn.setDefault(True)   self.close_btn.setFocus()   self.cancel_btn.setHidden(True)   else:
 
512
513
514
 
515
516
517
 
566
567
568
569
 
 
570
571
572
 
626
627
628
 
629
630
631
 
512
513
514
515
516
517
518
 
567
568
569
 
570
571
572
573
574
 
628
629
630
631
632
633
634
@@ -512,6 +512,7 @@
  self.setFocusProxy(self._logwidget)   self.setRepository(None)   self.openPrompt() + self.suppressPrompt = False     def _initlogwidget(self):   self._logwidget = _LogWidgetForConsole(self) @@ -566,7 +567,8 @@
  try:   self._logwidget.appendLog(msg, label)   finally: - self.openPrompt() + if not self.suppressPrompt: + self.openPrompt()     @pyqtSlot(object)   def setRepository(self, repo): @@ -626,6 +628,7 @@
    @_cmdtable   def _cmd_hg(self, args): + self.closePrompt()   if self._repo:   args = ['--cwd', self._repo.root] + args   self._cmdcore.run(args)
 
38
39
40
 
 
41
42
43
 
70
71
72
 
 
73
74
75
 
38
39
40
41
42
43
44
45
 
72
73
74
75
76
77
78
79
@@ -38,6 +38,8 @@
  progress = pyqtSignal(QString, object, QString, QString, object)   output = pyqtSignal(QString, QString)   makeLogVisible = pyqtSignal(bool) + beginSuppressPrompt = pyqtSignal() + endSuppressPrompt = pyqtSignal()     def __init__(self, repo, pats, opts, embedded=False, parent=None, rev=None):   QWidget.__init__(self, parent=parent) @@ -70,6 +72,8 @@
  self.runner.output.connect(self.output)   self.runner.progress.connect(self.progress)   self.runner.makeLogVisible.connect(self.makeLogVisible) + self.runner.commandStarted.connect(self.beginSuppressPrompt) + self.runner.commandFinished.connect(self.endSuppressPrompt)   self.runner.commandFinished.connect(self.commandFinished)     layout = QVBoxLayout()
 
41
42
43
 
 
 
 
 
 
 
 
 
44
45
46
 
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@@ -41,6 +41,15 @@
  def output(self, msg, label):   self.logte.appendLog(msg, label)   + @pyqtSlot() + def beginSuppressPrompt(self): + self.logte.suppressPrompt = True + + @pyqtSlot() + def endSuppressPrompt(self): + self.logte.suppressPrompt = False + self.logte.openPrompt() +   def showEvent(self, event):   self.visibilityChanged.emit(True)  
 
354
355
356
 
 
 
 
 
 
 
 
357
358
359
 
437
438
439
 
 
 
 
 
 
 
 
 
 
 
 
 
440
441
442
 
354
355
356
357
358
359
360
361
362
363
364
365
366
367
 
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
@@ -354,6 +354,14 @@
  self._repo.invalidateui() # force reloading config immediately   self._filldefaults()   + @pyqtSlot() + def on_selectall_button_clicked(self): + self._changesets.selectAll() + + @pyqtSlot() + def on_selectnone_button_clicked(self): + self._changesets.selectNone() +  class _ChangesetsModel(QAbstractTableModel): # TODO: use component of log viewer?   _COLUMNS = [('rev', lambda ctx: '%d:%s' % (ctx.rev(), ctx)),   ('author', lambda ctx: hglib.username(ctx.user())), @@ -437,6 +445,19 @@
    return QVariant(self._COLUMNS[section][0].capitalize())   + def selectAll(self): + self._selectedrevs = set(self._revs) + self.updateAll() + + def selectNone(self): + self._selectedrevs = set() + self.updateAll() + + def updateAll(self): + first = self.createIndex(0, 0) + last = self.createIndex(len(self._revs) - 1, 0) + self.dataChanged.emit(first, last) +  def run(ui, *revs, **opts):   # TODO: same options as patchbomb   if opts.get('rev'):
 
7
8
9
10
 
11
12
13
 
357
358
359
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
361
362
 
7
8
9
 
10
11
12
13
 
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
@@ -7,7 +7,7 @@
  <x>0</x>   <y>0</y>   <width>660</width> - <height>506</height> + <height>519</height>   </rect>   </property>   <property name="windowTitle"> @@ -357,6 +357,37 @@
  </property>   </widget>   </item> + <item> + <layout class="QHBoxLayout" name="selectallnone_layout"> + <item> + <widget class="QPushButton" name="selectall_button"> + <property name="text"> + <string>Select &amp;All</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="selectnone_button"> + <property name="text"> + <string>Select &amp;None</string> + </property> + </widget> + </item> + <item> + <spacer name="selectallnone_spacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item>   </layout>   </widget>   </widget>
 
570
571
572
573
574
575
576
577
578
 
 
 
 
579
580
581
 
570
571
572
 
 
 
 
573
574
575
576
577
578
579
580
581
@@ -570,12 +570,12 @@
  try:   char = s[s.index('&')+1].lower()   self.hotkeys[char] = btn - if default == i: - self.setDefaultButton(btn) - if esc == i: - self.setEscapeButton(btn)   except (ValueError, IndexError):   pass + if default == i: + self.setDefaultButton(btn) + if esc == i: + self.setEscapeButton(btn)     def run(self):   return self.exec_()
 
80
81
82
 
 
 
 
 
 
83
84
85
 
119
120
121
122
 
 
 
 
123
124
125
 
139
140
141
142
 
 
 
 
143
144
145
 
147
148
149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
151
152
 
181
182
183
184
 
 
 
 
185
186
187
 
80
81
82
83
84
85
86
87
88
89
90
91
 
125
126
127
 
128
129
130
131
132
133
134
 
148
149
150
 
151
152
153
154
155
156
157
 
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
 
212
213
214
 
215
216
217
218
219
220
221
@@ -80,6 +80,12 @@
  if self.command == 'revert':   ## no backup checkbox   chk = QCheckBox(_('Do not save backup files (*.orig)')) + elif self.command == 'remove': + ## force checkbox + chk = QCheckBox(_('Force removal of modified files (--force)')) + else: + chk = None + if chk:   self.chk = chk   hbox.addWidget(chk)   @@ -119,7 +125,10 @@
  stwidget.loadSettings(s, 'quickop')   self.restoreGeometry(s.value('quickop/geom').toByteArray())   if hasattr(self, 'chk'): - self.chk.setChecked(s.value('quickop/nobackup', True).toBool()) + if self.command == 'revert': + self.chk.setChecked(s.value('quickop/nobackup', True).toBool()) + elif self.command == 'remove': + self.chk.setChecked(s.value('quickop/forceremove', False).toBool())   self.stwidget = stwidget   self.stwidget.refreshWctx()   QShortcut(QKeySequence('Ctrl+Return'), self, self.accept) @@ -139,7 +148,10 @@
  def accept(self):   cmdline = [self.command]   if hasattr(self, 'chk') and self.chk.isChecked(): - cmdline.append('--no-backup') + if self.command == 'revert': + cmdline.append('--no-backup') + elif self.command == 'remove': + cmdline.append('--force')   files = self.stwidget.getChecked()   if not files:   qtlib.WarningMsgBox(_('No files selected'), @@ -147,6 +159,25 @@
  parent=self)   return   if self.command == 'remove': + if not self.chk.isChecked(): + modified = self.repo.status()[0] + selmodified = [] + for wfile in files: + if wfile in modified: + selmodified.append(wfile) + if selmodified: + prompt = qtlib.CustomPrompt(_('Confirm Remove'), + _('You have selected one or more files that have been ' + 'modified. By default, these files will not be ' + 'removed. What would you like to do?'), self, + (_('Remove &Unmodified Files'), + _('Remove &All Selected Files'), _('Cancel')), + 0, 2, selmodified) + ret = prompt.run() + if ret == 1: + cmdline.append('--force') + elif ret == 2: + return   self.repo.bfstatus = True   self.repo.lfstatus = True   repostate = self.repo.status() @@ -181,7 +212,10 @@
  self.stwidget.saveSettings(s, 'quickop')   s.setValue('quickop/geom', self.saveGeometry())   if hasattr(self, 'chk'): - s.setValue('quickop/nobackup', self.chk.isChecked()) + if self.command == 'revert': + s.setValue('quickop/nobackup', self.chk.isChecked()) + elif self.command == 'remove': + s.setValue('quickop/forceremove', self.chk.isChecked())   QDialog.reject(self)     def addLfiles(self):
 
44
45
46
 
 
47
48
49
 
116
117
118
 
 
119
120
121
 
343
344
345
 
 
346
347
348
 
367
368
369
 
 
370
371
372
 
44
45
46
47
48
49
50
51
 
118
119
120
121
122
123
124
125
 
347
348
349
350
351
352
353
354
 
373
374
375
376
377
378
379
380
@@ -44,6 +44,8 @@
  output = pyqtSignal(QString, QString)   progress = pyqtSignal(QString, object, QString, QString, object)   makeLogVisible = pyqtSignal(bool) + beginSuppressPrompt = pyqtSignal() + endSuppressPrompt = pyqtSignal()     repoChanged = pyqtSignal(QString)   @@ -116,6 +118,8 @@
  self.runner.output.connect(self.output)   self.runner.progress.connect(self.progress)   self.runner.makeLogVisible.connect(self.makeLogVisible) + self.runner.commandStarted.connect(self.beginSuppressPrompt) + self.runner.commandFinished.connect(self.endSuppressPrompt)   self.runner.commandFinished.connect(self.onCommandFinished)     # Select the widget chosen by the user @@ -343,6 +347,8 @@
  cw.output.connect(self.output)   cw.progress.connect(self.progress)   cw.makeLogVisible.connect(self.makeLogVisible) + cw.beginSuppressPrompt.connect(self.beginSuppressPrompt) + cw.endSuppressPrompt.connect(self.endSuppressPrompt)   cw.linkActivated.connect(self._openLink)   cw.showMessage.connect(self.showMessage)   QTimer.singleShot(0, cw.reload) @@ -367,6 +373,8 @@
  sw.output.connect(self._showOutputOnInfoBar)   sw.progress.connect(self.progress)   sw.makeLogVisible.connect(self.makeLogVisible) + sw.beginSuppressPrompt.connect(self.beginSuppressPrompt) + sw.endSuppressPrompt.connect(self.endSuppressPrompt)   sw.syncStarted.connect(self.clearInfoBar)   sw.outgoingNodes.connect(self.setOutgoingNodes)   sw.showMessage.connect(self.showMessage)
 
36
37
38
39
 
 
40
41
42
 
61
62
63
 
 
64
65
66
 
288
289
290
 
291
 
292
293
294
 
295
 
 
296
297
298
 
650
651
652
 
653
654
655
 
706
707
708
 
 
 
 
709
710
711
 
902
903
904
 
905
906
907
 
909
910
911
912
 
913
914
915
 
921
922
923
 
 
 
 
 
 
 
 
 
 
 
 
924
925
926
 
928
929
930
931
 
 
932
933
934
 
1160
1161
1162
1163
 
1164
1165
1166
 
36
37
38
 
39
40
41
42
43
 
62
63
64
65
66
67
68
69
 
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
 
658
659
660
661
662
663
664
 
715
716
717
718
719
720
721
722
723
724
 
915
916
917
918
919
920
921
 
923
924
925
 
926
927
928
929
 
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
 
954
955
956
 
957
958
959
960
961
 
1187
1188
1189
 
1190
1191
1192
1193
@@ -36,7 +36,8 @@
  port = m.group(3)   folder = m.group(5) or '.'   else: - qtlib.WarningMsgBox(_('Malformed ssh URL'), hglib.tounicode(path)) + qtlib.WarningMsgBox(_('Malformed ssh URL'), hglib.tounicode(path), + parent=self)   host, port, folder = '', '', ''   elif path.startswith(('http://', 'https://', 'svn+https://')):   snpaqf = urlparse.urlparse(path) @@ -61,6 +62,8 @@
  output = pyqtSignal(QString, QString)   progress = pyqtSignal(QString, object, QString, QString, object)   makeLogVisible = pyqtSignal(bool) + beginSuppressPrompt = pyqtSignal() + endSuppressPrompt = pyqtSignal()   showBusyIcon = pyqtSignal(QString)   hideBusyIcon = pyqtSignal(QString)   @@ -288,11 +291,16 @@
  self.optionsbutton.pressed.connect(self.editOptions)     cmd = cmdui.Widget(not self.embedded, True, self) + cmd.commandStarted.connect(self.beginSuppressPrompt)   cmd.commandStarted.connect(self.commandStarted) + cmd.commandFinished.connect(self.endSuppressPrompt)   cmd.commandFinished.connect(self.commandFinished)   cmd.makeLogVisible.connect(self.makeLogVisible)   cmd.output.connect(self.output) + cmd.output.connect(self.outputHook)   cmd.progress.connect(self.progress) + if not self.embedded: + self.showMessage.connect(cmd.stbar.showMessage)     bottomlayout.addWidget(cmd)   cmd.setVisible(False) @@ -650,6 +658,7 @@
  def run(self, cmdline, details):   if self.cmd.core.running():   return + self.lastcmdline = list(cmdline)   for name in list(details) + ['remotecmd']:   val = self.opts.get(name)   if not val: @@ -706,6 +715,10 @@
  self.repo.incrementBusyCount()   self.cmd.run(cmdline, display=display, useproc='p4://' in cururl)   + def outputHook(self, msg, label): + if '\'hg push --new-branch\'' in msg: + self.needNewBranch = True +   ##   ## Workbench toolbar buttons   ## @@ -902,6 +915,7 @@
  self.run(['--repository', self.repo.root, 'p4pending', '--verbose'], ())     def pushclicked(self, confirm, rev=None, branch=None): + validopts = ('force', 'new-branch', 'branch', 'rev', 'bookmark')   self.syncStarted.emit()   url = self.currentUrl(True)   urlu = hglib.tounicode(url) @@ -909,7 +923,7 @@
  and not self.targetcheckbox.isChecked()):   r = qtlib.QuestionMsgBox(_('Confirm Push to remote Repository'),   _('Push to remote repository\n%s\n?') - % urlu) + % urlu, parent=self)   if not r:   self.showMessage.emit(_('Push to %s aborted') % urlu)   self.pushCompleted.emit() @@ -921,6 +935,18 @@
  self.showMessage.emit(_('Push to %s completed') % urlu)   else:   self.showMessage.emit(_('Push to %s aborted, ret %d') % (urlu, ret)) + if self.needNewBranch: + r = qtlib.QuestionMsgBox(_('Confirm New Branch'), + _('One or more of the changesets that you ' + 'are attempting to push involve the ' + 'creation of a new branch. Do you want ' + 'to create a new branch in the remote ' + 'repository?'), parent=self) + if r: + cmdline = self.lastcmdline + cmdline.extend(['--new-branch']) + self.run(cmdline, validopts) + return   self.pushCompleted.emit()   self.finishfunc = finished   cmdline = ['--repository', self.repo.root, 'push'] @@ -928,7 +954,8 @@
  cmdline.extend(['--rev', str(rev)])   if branch:   cmdline.extend(['--branch', branch]) - self.run(cmdline, ('force', 'new-branch', 'branch', 'rev', 'bookmark')) + self.needNewBranch = False + self.run(cmdline, validopts)     def postpullclicked(self):   dlg = PostPullDialog(self.repo, self) @@ -1160,7 +1187,7 @@
  path = self.origurl   if alias in cfg['paths']:   if not qtlib.QuestionMsgBox(_('Confirm URL replace'), - _('%s already exists, replace URL?') % alias): + _('%s already exists, replace URL?') % alias, parent=self):   return   cfg.set('paths', alias, path)   self.repo.incrementBusyCount()
 
310
311
312
313
314
 
 
315
316
317
318
 
319
320
321
 
310
311
312
 
 
313
314
315
316
317
 
318
319
320
321
@@ -310,12 +310,12 @@
  from tortoisehg.hgqt.guess import DetectRenameDialog   dlg = DetectRenameDialog(repo, parent, *files)   def matched(): - ret = True - ret = False + ret[0] = True + ret = [False]   dlg.matchAccepted.connect(matched)   dlg.finished.connect(dlg.deleteLater)   dlg.exec_() - return ret + return ret[0]    def ignore(parent, ui, repo, files):   from tortoisehg.hgqt.hgignore import HgignoreDialog
 
654
655
656
 
 
657
658
659
 
654
655
656
657
658
659
660
661
@@ -654,6 +654,8 @@
  self.statusbar.progress(tp, p, i, u, tl, repo.root))   rw.output.connect(self.log.output)   rw.makeLogVisible.connect(self.log.setShown) + rw.beginSuppressPrompt.connect(self.log.beginSuppressPrompt) + rw.endSuppressPrompt.connect(self.log.endSuppressPrompt)   rw.revisionSelected.connect(self.updateHistoryActions)   rw.repoLinkClicked.connect(self.openLinkedRepo)   rw.taskTabsWidget.currentChanged.connect(self.updateTaskViewMenu)