Commits

Yuya Nishihara committed fb58358 Merge

merge

Comments (0)

Files changed (4)

repow-useagent-repowfixup.diff

+# HG changeset patch
+# Date 1376832746 -32400
+# Parent ca2d357ae8beb3b2191e9c611f67233256291f57
+repowidget: remove unneeded --repository option from command-line
+
+Now --cwd root is appended automatically.
+
+diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
+--- a/tortoisehg/hgqt/repowidget.py
++++ b/tortoisehg/hgqt/repowidget.py
+@@ -885,7 +885,7 @@ class RepoWidget(QWidget):
+                       'by this rollback, leaving uncommitted changes.\n '
+                       'Continue?' % rev)):
+                 return
+-        cmdline = ['rollback', '--repository', self.repo.root, '--verbose']
++        cmdline = ['rollback', '--verbose']
+         self.runCommand(cmdline)
+ 
+     def purge(self):
+@@ -1715,8 +1715,7 @@ class RepoWidget(QWidget):
+                                  hglib.fromunicode(self.repo.shortname)+'_%r.patch')
+             custompath = False
+ 
+-        cmdline = ['export', '--repository', self.repo.root, '--verbose',
+-                   '--output', epath]
++        cmdline = ['export', '--verbose', '--output', epath]
+ 
+         existingRevisions = []
+         for rev in revisions:
+@@ -1958,7 +1957,7 @@ class RepoWidget(QWidget):
+         if not file:
+             return
+ 
+-        cmdline = ['bundle', '--verbose', '--repository', root]
++        cmdline = ['bundle', '--verbose']
+         parents = [r.rev() == -1 and 'null' or str(r.rev())
+                    for r in self.repo[base].parents()]
+         for p in parents:
+@@ -2018,7 +2017,6 @@ class RepoWidget(QWidget):
+             return
+         phasestr = phases.phasenames[phase]
+         cmdlines = ['phase', '--rev', '%s' % self.rev,
+-               '--repository', self.repo.root,
+                ('--%s' % phasestr)]
+         if currentphase < phase:
+             # Ask the user if he wants to force the transition
+@@ -2131,20 +2129,17 @@ class RepoWidget(QWidget):
+             cmdlines = []
+             for rev in revList:
+                 cmdlines.append(['qimport', '--rev', '%s' % rev,
+-                           '--repository', self.repo.root,
+                            '--name', patchNames[rev]])
+             self.runCommand(*cmdlines)
+         else:
+             # There were no collisions with existing patch names, we can
+             # simply qimport the whole revision set in a single go
+-            cmdline = ['qimport', '--rev', '%s::%s' % (self.rev, endrev),
+-                       '--repository', self.repo.root]
++            cmdline = ['qimport', '--rev', '%s::%s' % (self.rev, endrev)]
+             self.runCommand(cmdline)
+ 
+     def qfinishRevision(self):
+         """Finish applied patches up to and including selected revision"""
+-        cmdline = ['qfinish', 'qbase::%s' % self.rev,
+-                   '--repository', self.repo.root]
++        cmdline = ['qfinish', 'qbase::%s' % self.rev]
+         self.runCommand(cmdline)
+ 
+     @pyqtSlot()
+@@ -2178,8 +2173,7 @@ class RepoWidget(QWidget):
+         """Make REV the top applied patch"""
+         ctx = self.repo.changectx(self.rev)
+         patchname = ctx.thgmqpatchname()
+-        cmdline = ['qpush', '--move', str(patchname),
+-                   '--repository', self.repo.root]
++        cmdline = ['qpush', '--move', str(patchname)]
+         self.runCommand(cmdline)
+ 
+     def onCommandFinished(self, ret):
+@@ -2233,8 +2227,6 @@ class RepoWidget(QWidget):
+         cmd = shlex.split(command)
+         if cmd[0].lower() == 'hg':
+             cmd = cmd[1:]
+-            if '--repository' not in cmd:
+-                cmd += ['--repository', self.repo.root]
+             return self.runCommand(cmd)
+ 
+         # Otherwise, run the selected command in the background

repow-useagent.diff

+# HG changeset patch
+# Date 1376808576 -32400
+# Parent 9e32df8256536eeec0d224e30fea95b047c4d209
+repowidget: use RepoAgent to run Mercurial commands
+
+diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
+--- a/tortoisehg/hgqt/repowidget.py
++++ b/tortoisehg/hgqt/repowidget.py
+@@ -42,6 +42,7 @@ class RepoWidget(QWidget):
+     showMessageSignal = pyqtSignal(QString)
+     toolbarVisibilityChanged = pyqtSignal()
+ 
++    # TODO: output and progress can be removed if all widgets use RepoAgent
+     output = pyqtSignal(QString, QString)
+     progress = pyqtSignal(QString, object, QString, QString, object)
+     makeLogVisible = pyqtSignal(bool)
+@@ -110,12 +111,6 @@ class RepoWidget(QWidget):
+         if bundle:
+             self.setBundle(bundle)
+ 
+-        self.runner = cmdui.Runner(False, self)
+-        self.runner.output.connect(self.output)
+-        self.runner.progress.connect(self.progress)
+-        self.runner.makeLogVisible.connect(self.makeLogVisible)
+-        self.runner.commandFinished.connect(self.onCommandFinished)
+-
+         self._dialogs = qtlib.DialogKeeper(
+             lambda self, dlgmeth, *args: dlgmeth(self, *args), parent=self)
+ 
+@@ -1167,7 +1162,7 @@ class RepoWidget(QWidget):
+             self.taskTabsWidget.setCurrentIndex(self.grepTabIndex)
+             self.showMessage(_('Search tab cannot exit'))
+             return False
+-        if self.runner.core.running():
++        if self._repoagent.isBusy():
+             self.showMessage(_('Repository command still running'))
+             return False
+         return True
+@@ -2188,8 +2183,9 @@ class RepoWidget(QWidget):
+         self.runCommand(cmdline)
+ 
+     def onCommandFinished(self, ret):
+-        self.repo.decrementBusyCount()
+         shlib.shell_notify([self.repo.root])
++        if ret != 0:
++            self.makeLogVisible.emit()
+ 
+ 
+     def runCustomCommand(self, command, showoutput=False, workingdir='',
+@@ -2270,12 +2266,13 @@ class RepoWidget(QWidget):
+         self.runCustomCommand(command, showoutput, workingdir, files)
+ 
+     def runCommand(self, *cmdlines):
+-        if self.runner.core.running():
++        if self._repoagent.isBusy():
+             InfoMsgBox(_('Unable to start'),
+                        _('Previous command is still running'))
+             return
+-        self.repo.incrementBusyCount()
+-        self.runner.run(*cmdlines)
++        ucmdlines = [map(hglib.tounicode, xs) for xs in cmdlines]
++        sess = self._repoagent.runCommandSequence(ucmdlines, self)
++        sess.commandFinished.connect(self.onCommandFinished)
+ 
+     @pyqtSlot()
+     def _refreshCommitTabIfNeeded(self):
 docklog-cmdagent.diff
 docklog-useagent.diff
 repowdlg-useagent.diff
+repow-useagent.diff
+repow-useagent-repowfixup.diff
+update-useagent.diff
 docklogdebug.diff
 serve-run-bot.diff
 serve-loadconf.diff

update-useagent.diff

+# HG changeset patch
+# Date 1376809671 -32400
+# Parent 394f5d2e48658545a793638c31cde3876b279b7f
+update: use RepoAgent to run Mercurial commands
+
+TODO: not tested well
+
+diff --git a/tortoisehg/hgqt/pbranch.py b/tortoisehg/hgqt/pbranch.py
+--- a/tortoisehg/hgqt/pbranch.py
++++ b/tortoisehg/hgqt/pbranch.py
+@@ -570,9 +570,7 @@ class PatchBranchWidget(QWidget, qtlib.T
+         # TODO: Fetch list of heads of branch
+         # - use a list of revs if more than one found
+         dlg = update.UpdateDialog(self._repoagent, branch, self)
+-        dlg.output.connect(self.output)
+         dlg.makeLogVisible.connect(self.makeLogVisible)
+-        dlg.progress.connect(self.progress)
+         dlg.exec_()
+ 
+     def merge_activated(self):
+diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
+--- a/tortoisehg/hgqt/repowidget.py
++++ b/tortoisehg/hgqt/repowidget.py
+@@ -1812,9 +1812,7 @@ class RepoWidget(QWidget):
+     def updateToRevision(self):
+         rev = hglib.getrevisionlabel(self.repo, self.rev)
+         dlg = update.UpdateDialog(self._repoagent, rev, self)
+-        dlg.output.connect(self.output)
+         dlg.makeLogVisible.connect(self.makeLogVisible)
+-        dlg.progress.connect(self.progress)
+         dlg.exec_()
+ 
+     def matchRevision(self):
+@@ -1918,9 +1916,7 @@ class RepoWidget(QWidget):
+     def rupdate(self):
+         import rupdate
+         dlg = rupdate.rUpdateDialog(self._repoagent, self.rev, self)
+-        dlg.output.connect(self.output)
+         dlg.makeLogVisible.connect(self.makeLogVisible)
+-        dlg.progress.connect(self.progress)
+         dlg.exec_()
+ 
+     @pyqtSlot()
+diff --git a/tortoisehg/hgqt/rupdate.py b/tortoisehg/hgqt/rupdate.py
+--- a/tortoisehg/hgqt/rupdate.py
++++ b/tortoisehg/hgqt/rupdate.py
+@@ -118,7 +118,7 @@ class rUpdateDialog(UpdateDialog):
+ 
+     def update(self):
+         self.saveSettings()
+-        cmdline = ['rupdate', '--repository', self.repo.root]
++        cmdline = ['rupdate']
+ 
+         if self.discard_chk.isChecked():
+             cmdline.append('--clean')
+@@ -139,7 +139,6 @@ class rUpdateDialog(UpdateDialog):
+         cmdline.append(revHash)
+ 
+         # start updating
+-        self.repo.incrementBusyCount()
+         self.cmd.run(cmdline)
+ 
+     ### Signal Handlers ###
+diff --git a/tortoisehg/hgqt/update.py b/tortoisehg/hgqt/update.py
+--- a/tortoisehg/hgqt/update.py
++++ b/tortoisehg/hgqt/update.py
+@@ -18,8 +18,6 @@ from PyQt4.QtGui import *
+ 
+ class UpdateDialog(QDialog):
+ 
+-    output = pyqtSignal(QString, QString)
+-    progress = pyqtSignal(QString, object, QString, QString, object)
+     makeLogVisible = pyqtSignal(bool)
+ 
+     def __init__(self, repoagent, rev=None, parent=None, opts={}):
+@@ -137,13 +135,11 @@ class UpdateDialog(QDialog):
+         self.verbose_chk.setChecked(s.value('update/verbose', False).toBool())
+ 
+         ## command widget
+-        self.cmd = cmdui.Widget(True, True, self)
++        self.cmd = cmdui.Widget(True, True, self, self._repoagent)
+         self.cmd.commandStarted.connect(self.command_started)
+         self.cmd.commandFinished.connect(self.command_finished)
+         self.cmd.commandCanceling.connect(self.command_canceling)
+-        self.cmd.output.connect(self.output)
+         self.cmd.makeLogVisible.connect(self.makeLogVisible)
+-        self.cmd.progress.connect(self.progress)
+         box.addWidget(self.cmd)
+ 
+         ## bottom buttons
+@@ -233,7 +229,7 @@ class UpdateDialog(QDialog):
+ 
+     def update(self):
+         self.saveSettings()
+-        cmdline = ['update', '--repository', self.repo.root]
++        cmdline = ['update']
+         if self.verbose_chk.isChecked():
+             cmdline += ['--verbose']
+         cmdline += ['--config', 'ui.merge=internal:' +
+@@ -285,11 +281,10 @@ class UpdateDialog(QDialog):
+                         _('Do you really want to deactivate the <i>%s</i> '
+                         'bookmark?') % self.repo._bookmarkcurrent)
+                     if deactivatebookmark:
+-                        cmdline = ['bookmark', '--repository', self.repo.root]
++                        cmdline = ['bookmark']
+                         if self.verbose_chk.isChecked():
+                             cmdline += ['--verbose']
+                         cmdline += ['-i', self.repo._bookmarkcurrent]
+-                        self.repo.incrementBusyCount()
+                         self.cmd.run(cmdline)
+                     return
+ 
+@@ -385,7 +380,6 @@ class UpdateDialog(QDialog):
+                     return
+ 
+         # start updating
+-        self.repo.incrementBusyCount()
+         self.cmd.run(cmdline)
+ 
+     ### Signal Handlers ###
+@@ -412,7 +406,6 @@ class UpdateDialog(QDialog):
+         self.detail_btn.setShown(True)
+ 
+     def command_finished(self, ret):
+-        self.repo.decrementBusyCount()
+         if ret not in (0, 1) or self.cmd.outputShown():
+             self.detail_btn.setChecked(True)
+             self.close_btn.setShown(True)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.