Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1, 2.1.1, and 2.1.2

status, commit: take a repo object like everyone else

Changeset 8334a1ccdbd3

Parent 76d925893a37

by Steve Borho

Changes to 10 files · Browse files at 8334a1ccdbd3 Showing diff from parent 76d925893a37 Diff from another changeset...

 
232
233
234
235
 
236
237
238
 
260
261
262
263
 
264
265
266
 
464
465
466
467
 
468
469
470
 
232
233
234
 
235
236
237
238
 
260
261
262
 
263
264
265
266
 
464
465
466
 
467
468
469
470
@@ -232,7 +232,7 @@
  cmd = hglib.fromunicode(cmd)   repo = self.repo   if cmd == 'commit': - dlg = commit.CommitDialog([], dict(root=repo.root), self) + dlg = commit.CommitDialog(repo, [], {}, self.wizard())   dlg.finished.connect(dlg.deleteLater)   dlg.exec_()   self.refresh() @@ -260,7 +260,7 @@
  repo.incrementBusyCount()   self.runner.run(cmdline)   elif cmd == 'view': - dlg = status.StatusDialog([], {}, repo.root, self) + dlg = status.StatusDialog(repo, [], {}, self)   dlg.exec_()   self.refresh()   else: @@ -464,7 +464,7 @@
  @pyqtSlot(QString)   def onLinkActivated(self, cmd):   if cmd == 'view': - dlg = status.StatusDialog([], {}, self.repo.root, self) + dlg = status.StatusDialog(self.repo, [], {}, self)   dlg.exec_()   self.refresh()  
 
164
165
166
167
 
168
169
 
 
 
 
 
 
 
 
 
 
170
171
 
 
172
173
174
175
176
177
178
179
180
 
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
 
936
937
938
939
 
940
941
942
 
949
950
951
952
 
953
954
955
 
976
977
978
979
 
980
981
982
983
 
984
985
986
 
1043
1044
1045
1046
 
 
164
165
166
 
167
168
169
170
171
172
173
174
175
176
177
178
179
180
 
181
182
183
184
185
186
187
 
188
189
190
 
192
193
194
 
 
 
 
 
 
 
 
 
 
195
196
197
 
936
937
938
 
939
940
941
942
 
949
950
951
 
952
953
954
955
 
976
977
978
 
979
980
981
982
 
983
984
985
986
 
1043
1044
1045
 
1046
@@ -164,17 +164,27 @@
  output = pyqtSignal(QString, QString)   makeLogVisible = pyqtSignal(bool)   - def __init__(self, pats, opts, root=None, embedded=False, parent=None): + def __init__(self, repo, pats, opts, embedded=False, parent=None):   QWidget.__init__(self, parent=parent)   + repo.configChanged.connect(self.configChanged) + repo.repositoryChanged.connect(self.repositoryChanged) + repo.workingBranchChanged.connect(self.workingBranchChanged) + self.repo = repo + + opts['ciexclude'] = repo.ui.config('tortoisehg', 'ciexclude', '') + opts['pushafter'] = repo.ui.config('tortoisehg', 'cipushafter', '') + opts['autoinc'] = repo.ui.config('tortoisehg', 'autoinc', '') + opts['bugtraqplugin'] = repo.ui.config('tortoisehg', 'issue.bugtraqplugin', None) + opts['bugtraqparameters'] = repo.ui.config('tortoisehg', 'tortoisehg.issue.bugtraqparameters', None)   self.opts = opts # user, date - self.stwidget = status.StatusWidget(pats, opts, root, self) + + self.stwidget = status.StatusWidget(repo, pats, opts, self)   self.stwidget.showMessage.connect(self.showMessage)   self.stwidget.progress.connect(self.progress)   self.stwidget.linkActivated.connect(self.linkActivated)   self.stwidget.fileDisplayed.connect(self.fileDisplayed)   self.msghistory = [] - self.repo = repo = self.stwidget.repo   self.runner = cmdui.Runner(not embedded, self)   self.runner.setTitle(_('Commit', 'window title'))   self.runner.output.connect(self.output) @@ -182,16 +192,6 @@
  self.runner.makeLogVisible.connect(self.makeLogVisible)   self.runner.commandFinished.connect(self.commandFinished)   - repo.configChanged.connect(self.configChanged) - repo.repositoryChanged.connect(self.repositoryChanged) - repo.workingBranchChanged.connect(self.workingBranchChanged) - - self.opts['pushafter'] = repo.ui.config('tortoisehg', 'cipushafter', '') - self.opts['autoinc'] = repo.ui.config('tortoisehg', 'autoinc', '') - self.opts['bugtraqplugin'] = repo.ui.config('tortoisehg', 'issue.bugtraqplugin', None) - self.opts['bugtraqparameters'] = repo.ui.config('tortoisehg', 'tortoisehg.issue.bugtraqparameters', None) - self.stwidget.opts['ciexclude'] = repo.ui.config('tortoisehg', 'ciexclude', '') -   layout = QVBoxLayout()   layout.setContentsMargins(2, 2, 2, 2)   layout.setSpacing(0) @@ -936,7 +936,7 @@
 class CommitDialog(QDialog):   'Standalone commit tool, a wrapper for CommitWidget'   - def __init__(self, pats, opts, parent=None): + def __init__(self, repo, pats, opts, parent=None):   QDialog.__init__(self, parent)   self.setWindowFlags(Qt.Window)   self.setWindowIcon(qtlib.geticon('hg-commit')) @@ -949,7 +949,7 @@
  layout.setSpacing(0)   self.setLayout(layout)   - commit = CommitWidget(pats, opts, opts.get('root'), False, self) + commit = CommitWidget(repo, pats, opts, False, self)   layout.addWidget(commit, 1)     self.statusbar = cmdui.ThgStatusBar(self) @@ -976,11 +976,11 @@
  s = QSettings()   self.restoreGeometry(s.value('commit/geom').toByteArray())   commit.loadSettings(s, 'committool') - commit.repo.repositoryChanged.connect(self.updateUndo) + repo.repositoryChanged.connect(self.updateUndo)   commit.commitComplete.connect(self.postcommit)   commit.commitButtonEnable.connect(self.commitButton.setEnabled)   - self.setWindowTitle(_('%s - commit') % commit.repo.displayname) + self.setWindowTitle(_('%s - commit') % repo.displayname)   self.commit = commit   self.commit.reload()   self.updateUndo() @@ -1043,4 +1043,4 @@
  repo = thgrepo.repository(ui, path=paths.find_root())   pats = hglib.canonpaths(pats)   os.chdir(repo.root) - return CommitDialog(pats, opts) + return CommitDialog(repo, pats, opts)
 
131
132
133
134
 
135
136
137
 
141
142
143
144
 
145
146
147
 
131
132
133
 
134
135
136
137
 
141
142
143
 
144
145
146
147
@@ -131,7 +131,7 @@
  descs = [self.repo[c].description() for c in revs]   self.repo.opener('cur-message.txt', 'w').write('\n* * *\n'.join(descs))   - dlg = commit.CommitDialog([], dict(root=self.repo.root), self) + dlg = commit.CommitDialog(self.repo, [], {}, self)   dlg.finished.connect(dlg.deleteLater)   dlg.exec_()   self.showMessage.emit(_('Compress is complete, old history untouched')) @@ -141,7 +141,7 @@
    def linkActivated(self, cmd):   if cmd == 'commit': - dlg = commit.CommitDialog([], dict(root=self.repo.root), self) + dlg = commit.CommitDialog(self.repo, [], {}, self)   dlg.finished.connect(dlg.deleteLater)   dlg.exec_()   self.checkStatus()
 
295
296
297
298
 
299
300
301
 
323
324
325
326
 
327
328
329
 
548
549
550
551
 
552
553
554
 
295
296
297
 
298
299
300
301
 
323
324
325
 
326
327
328
329
 
548
549
550
 
551
552
553
554
@@ -295,7 +295,7 @@
  cmd = hglib.fromunicode(cmd)   repo = self.repo   if cmd == 'commit': - dlg = commit.CommitDialog([], dict(root=repo.root), self) + dlg = commit.CommitDialog(repo, [], {}, self)   dlg.finished.connect(dlg.deleteLater)   dlg.exec_()   self.refresh() @@ -323,7 +323,7 @@
  repo.incrementBusyCount()   self.runner.run(cmdline)   elif cmd == 'view': - dlg = status.StatusDialog([], {}, repo.root, self) + dlg = status.StatusDialog(repo, [], {}, self)   dlg.exec_()   self.refresh()   elif cmd == 'skip': @@ -548,7 +548,7 @@
  @pyqtSlot(QString)   def onLinkActivated(self, cmd):   if cmd == 'view': - dlg = status.StatusDialog([], {}, self.repo.root, self) + dlg = status.StatusDialog(self.repo, [], {}, self)   dlg.exec_()   self.refresh()  
 
18
19
20
21
 
22
23
24
 
560
561
562
563
 
 
564
565
566
 
996
997
998
999
1000
1001
 
18
19
20
 
21
22
23
24
 
560
561
562
 
563
564
565
566
567
 
997
998
999
 
1000
1001
@@ -18,7 +18,7 @@
   from tortoisehg.util import hglib, patchctx  from tortoisehg.hgqt.i18n import _ -from tortoisehg.hgqt import qtlib, cmdui, rejects, commit, qscilib +from tortoisehg.hgqt import qtlib, cmdui, rejects, commit, qscilib, thgrepo  from tortoisehg.hgqt import qqueue, qreorder, fileview, thgimport  from tortoisehg.hgqt.qtlib import geticon   @@ -560,7 +560,8 @@
  @pyqtSlot()   def qinitOrCommit(self):   if os.path.isdir(self.repo.mq.join('.hg')): - dlg = commit.CommitDialog([], dict(root=self.repo.mq.path), self) + mqrepo = thgrepo.repository(None, self.repo.mq.path) + dlg = commit.CommitDialog(mqrepo, [], {}, self)   dlg.finished.connect(dlg.deleteLater)   dlg.exec_()   self.reload() @@ -996,6 +997,5 @@
   def run(ui, *pats, **opts):   from tortoisehg.util import paths - from tortoisehg.hgqt import thgrepo   repo = thgrepo.repository(ui, path=paths.find_root())   return MQWidget(repo, None, **opts)
 
70
71
72
73
 
74
75
76
 
70
71
72
 
73
74
75
76
@@ -70,7 +70,7 @@
  opts[val.name] = s in filetypes     opts['checkall'] = True # pre-check all matching files - stwidget = status.StatusWidget(pats, opts, repo.root, self) + stwidget = status.StatusWidget(repo, pats, opts, self)   layout.addWidget(stwidget, 1)     if self.command == 'revert':
 
219
220
221
222
 
223
224
225
 
219
220
221
 
222
223
224
225
@@ -219,7 +219,7 @@
  dlg.exec_()   self.checkResolve()   elif cmd == 'commit': - dlg = commit.CommitDialog([], dict(root=self.repo.root), self) + dlg = commit.CommitDialog(self.repo, [], {}, self)   dlg.finished.connect(dlg.deleteLater)   dlg.exec_()   self.destcsinfo.update(self.repo['.'])
 
241
242
243
244
 
245
246
247
 
241
242
243
 
244
245
246
247
@@ -241,7 +241,7 @@
    def createCommitWidget(self):   pats, opts = {}, {} - cw = CommitWidget(pats, opts, self.repo.root, True, self) + cw = CommitWidget(self.repo, pats, opts, True, self)     b = QPushButton(_('Commit', 'action button'))   b.setAutoDefault(True)
 
7
8
9
10
11
12
13
 
 
14
15
 
16
17
18
 
49
50
51
52
 
53
54
55
56
57
58
59
60
 
61
62
63
 
826
827
828
829
 
830
831
832
833
834
835
 
836
837
838
 
854
855
856
857
 
858
859
860
861
 
862
863
864
 
891
892
893
894
 
 
7
8
9
 
 
 
 
10
11
12
13
14
15
16
17
 
48
49
50
 
51
52
53
 
 
 
54
55
56
57
58
59
60
 
823
824
825
 
826
827
828
829
830
831
 
832
833
834
835
 
851
852
853
 
854
855
 
856
 
857
858
859
860
 
887
888
889
 
890
@@ -7,12 +7,11 @@
   import os   -from mercurial import ui, hg, util, patch, cmdutil, error, mdiff -from mercurial import context, merge, commands, subrepo -from tortoisehg.hgqt import qtlib, htmlui, wctxactions, visdiff -from tortoisehg.hgqt import thgrepo, cmdui, fileview +from mercurial import hg, util, cmdutil, error, context, merge +  from tortoisehg.util import paths, hglib  from tortoisehg.hgqt.i18n import _ +from tortoisehg.hgqt import qtlib, htmlui, wctxactions, visdiff, cmdui, fileview    from PyQt4.QtCore import *  from PyQt4.QtGui import * @@ -49,15 +48,13 @@
  showMessage = pyqtSignal(unicode)   fileDisplayed = pyqtSignal(QString, QString)   - def __init__(self, pats, opts, root=None, parent=None): + def __init__(self, repo, pats, opts, parent=None):   QWidget.__init__(self, parent)   - root = paths.find_root(root) - assert(root) - self.repo = thgrepo.repository(ui.ui(), path=root)   self.opts = dict(modified=True, added=True, removed=True, deleted=True,   unknown=True, clean=False, ignored=False, subrepo=True)   self.opts.update(opts) + self.repo = repo   self.pats = pats   self.refthread = None   @@ -826,13 +823,13 @@
   class StatusDialog(QDialog):   'Standalone status browser' - def __init__(self, pats, opts, root=None, parent=None): + def __init__(self, repo, pats, opts, parent=None):   QDialog.__init__(self, parent)   self.setWindowIcon(qtlib.geticon('hg-status'))   layout = QVBoxLayout()   layout.setContentsMargins(0, 6, 0, 0)   self.setLayout(layout) - self.stwidget = StatusWidget(pats, opts, root, self) + self.stwidget = StatusWidget(repo, pats, opts, self)   layout.addWidget(self.stwidget, 1)     self.statusbar = cmdui.ThgStatusBar(self) @@ -854,11 +851,10 @@
  if link.startswith('subrepo:'):   from tortoisehg.hgqt.run import qtrun   from tortoisehg.hgqt import commit - qtrun(commit.run, ui.ui(), root=link[8:]) + qtrun(commit.run, self.commit.repo.ui, root=link[8:])   if link.startswith('shelve:'): - repo = self.commit.repo   from tortoisehg.hgqt import shelve - dlg = shelve.ShelveDialog(repo, self) + dlg = shelve.ShelveDialog(self.stwidget.repo, self)   dlg.finished.connect(dlg.deleteLater)   dlg.exec_()   self.refresh() @@ -891,4 +887,4 @@
  repo = thgrepo.repository(ui, path=paths.find_root())   pats = hglib.canonpaths(pats)   os.chdir(repo.root) - return StatusDialog(pats, opts) + return StatusDialog(repo, pats, opts)
 
145
146
147
148
 
149
150
151
 
145
146
147
 
148
149
150
151
@@ -145,7 +145,7 @@
    def checkStatus(self):   def activated(): - dlg = commit.CommitDialog([], dict(root=self.repo.root), self) + dlg = commit.CommitDialog(self.repo, [], {}, self)   dlg.finished.connect(dlg.deleteLater)   dlg.exec_()   self.checkStatus()