Commits

Yuya Nishihara  committed cbdbb36 Merge

merge

  • Participants
  • Parent commits ac96c06, 54799f7

Comments (0)

Files changed (5)

File docklog-agentren.diff

+# HG changeset patch
+# Date 1376805605 -32400
+# Parent 652bc94820db3bb19eb50f7bd18d9c31c7a781c9
+docklog: rename _repoagent to _agent
+
+diff --git a/tortoisehg/hgqt/docklog.py b/tortoisehg/hgqt/docklog.py
+--- a/tortoisehg/hgqt/docklog.py
++++ b/tortoisehg/hgqt/docklog.py
+@@ -270,7 +270,7 @@ class ConsoleWidget(QWidget):
+         self.layout().setContentsMargins(0, 0, 0, 0)
+         self._initlogwidget()
+         self.setFocusProxy(self._logwidget)
+-        self._repoagent = None
++        self._agent = None
+         self.openPrompt()
+         self._commandHistory = []
+         self._commandIdx = 0
+@@ -430,26 +430,26 @@ class ConsoleWidget(QWidget):
+         try:
+             self._logwidget.appendLog(msg, label)
+         finally:
+-            if not self._repoagent or not self._repoagent.isBusy():
++            if not self._agent or not self._agent.isBusy():
+                 self.openPrompt()
+ 
+     def setRepoAgent(self, repoagent):
+         """Change the current working repository"""
+-        if self._repoagent:
+-            self._repoagent.busyChanged.disconnect(self._suppressPromptOnBusy)
+-        self._repoagent = repoagent
++        if self._agent:
++            self._agent.busyChanged.disconnect(self._suppressPromptOnBusy)
++        self._agent = repoagent
+         repoagent.busyChanged.connect(self._suppressPromptOnBusy)
+         repo = repoagent.rawRepo()
+         self._logwidget.setPrompt('%s%% ' % (repo and repo.displayname or ''))
+ 
+     def repoRootPath(self):
+-        if self._repoagent:
+-            return self._repoagent.rootPath()
++        if self._agent:
++            return self._agent.rootPath()
+ 
+     @property
+     def _repo(self):
+-        if self._repoagent:
+-            return self._repoagent.rawRepo()
++        if self._agent:
++            return self._agent.rawRepo()
+ 
+     @property
+     def cwd(self):

File docklog-cmdagent.diff

+# HG changeset patch
+# Date 1376806125 -32400
+# Parent 842422bc6386291e41c5e3eeb430c9a280c75f35
+docklog: provide CmdAgent instance by default
+
+diff --git a/tortoisehg/hgqt/docklog.py b/tortoisehg/hgqt/docklog.py
+--- a/tortoisehg/hgqt/docklog.py
++++ b/tortoisehg/hgqt/docklog.py
+@@ -14,7 +14,7 @@ from PyQt4.Qsci import QsciScintilla
+ from mercurial import commands, util
+ 
+ from tortoisehg.hgqt.i18n import _
+-from tortoisehg.hgqt import cmdui
++from tortoisehg.hgqt import cmdcore, cmdui
+ from tortoisehg.util import hglib
+ 
+ class _LogWidgetForConsole(cmdui.LogWidget):
+@@ -270,7 +270,8 @@ class ConsoleWidget(QWidget):
+         self.layout().setContentsMargins(0, 0, 0, 0)
+         self._initlogwidget()
+         self.setFocusProxy(self._logwidget)
+-        self._agent = None
++        self._agent = cmdcore.CmdAgent(self)
++        self._connectAgent()
+         self.openPrompt()
+         self._commandHistory = []
+         self._commandIdx = 0
+@@ -430,25 +431,31 @@ class ConsoleWidget(QWidget):
+         try:
+             self._logwidget.appendLog(msg, label)
+         finally:
+-            if not self._agent or not self._agent.isBusy():
++            if not self._agent.isBusy():
+                 self.openPrompt()
+ 
+     def setRepoAgent(self, repoagent):
+         """Change the current working repository"""
+-        if self._agent:
+-            self._agent.busyChanged.disconnect(self._suppressPromptOnBusy)
++        self._agent.busyChanged.disconnect(self._suppressPromptOnBusy)
++        if self._agent.parent() is self:
++            self._agent.setParent(None)
++
+         self._agent = repoagent
+-        repoagent.busyChanged.connect(self._suppressPromptOnBusy)
++        self._connectAgent()
+         repo = repoagent.rawRepo()
+         self._logwidget.setPrompt('%s%% ' % (repo and repo.displayname or ''))
+ 
++    def _connectAgent(self):
++        agent = self._agent
++        agent.busyChanged.connect(self._suppressPromptOnBusy)
++
+     def repoRootPath(self):
+-        if self._agent:
++        if util.safehasattr(self._agent, 'rootPath'):
+             return self._agent.rootPath()
+ 
+     @property
+     def _repo(self):
+-        if self._agent:
++        if util.safehasattr(self._agent, 'rawRepo'):
+             return self._agent.rawRepo()
+ 
+     @property

File docklog-useagent.diff

 # HG changeset patch
-# Date 1376735184 -32400
-# Parent b9cb68d694be6bdf68753c340d46e6e9dd578d06
+# Date 1376806287 -32400
+# Parent 4643474eafea2e812d0bcbb04e8dfcccf9d16822
+docklog: use RepoAgent or CmdAgent to run Mercurial commands
 
 diff --git a/tortoisehg/hgqt/docklog.py b/tortoisehg/hgqt/docklog.py
 --- a/tortoisehg/hgqt/docklog.py
 +++ b/tortoisehg/hgqt/docklog.py
-@@ -387,15 +387,6 @@ class ConsoleWidget(QWidget):
+@@ -388,15 +388,6 @@ class ConsoleWidget(QWidget):
              self._logwidget.ensureCursorVisible()
  
      @util.propertycache
      def _extproc(self):
          extproc = QProcess(self)
          extproc.started.connect(self.closePrompt)
-@@ -437,8 +428,12 @@ class ConsoleWidget(QWidget):
+@@ -437,6 +428,8 @@ class ConsoleWidget(QWidget):
+     def setRepoAgent(self, repoagent):
          """Change the current working repository"""
-         if self._repoagent:
-             self._repoagent.busyChanged.disconnect(self._suppressPromptOnBusy)
-+            self._repoagent.outputReceived.disconnect(self._logwidget.appendLog)
-+            self._repoagent.progressReceived.disconnect(self._emitProgress)
-         self._repoagent = repoagent
-         repoagent.busyChanged.connect(self._suppressPromptOnBusy)
-+        repoagent.outputReceived.connect(self._logwidget.appendLog)
-+        repoagent.progressReceived.connect(self._emitProgress)
-         repo = repoagent.rawRepo()
-         self._logwidget.setPrompt('%s%% ' % (repo and repo.displayname or ''))
+         self._agent.busyChanged.disconnect(self._suppressPromptOnBusy)
++        self._agent.outputReceived.disconnect(self._logwidget.appendLog)
++        self._agent.progressReceived.disconnect(self._emitProgress)
+         if self._agent.parent() is self:
+             self._agent.setParent(None)
  
-@@ -516,9 +511,8 @@ class ConsoleWidget(QWidget):
+@@ -448,6 +441,8 @@ class ConsoleWidget(QWidget):
+     def _connectAgent(self):
+         agent = self._agent
+         agent.busyChanged.connect(self._suppressPromptOnBusy)
++        agent.outputReceived.connect(self._logwidget.appendLog)
++        agent.progressReceived.connect(self._emitProgress)
+ 
+     def repoRootPath(self):
+         if util.safehasattr(self._agent, 'rootPath'):
+@@ -523,9 +518,7 @@ class ConsoleWidget(QWidget):
  
      def _cmd_hg(self, args):
          self.closePrompt()
 -        if self._repo:
 -            args = ['--cwd', self._repo.root] + args
 -        self._cmdcore.run(args)
-+        # XXX if no repoagent exist?
-+        self._repoagent.runCommand(map(hglib.tounicode, args))
++        self._agent.runCommand(map(hglib.tounicode, args))
  
      def _cmd_thg(self, args):
          from tortoisehg.hgqt import run

File repowdlg-useagent.diff

 # HG changeset patch
-# Date 1376744785 -32400
-# Parent 7c2b9d63c7eaca2eb7313ebd4e746bb76ccc3e11
+# Date 1376806585 -32400
+# Parent 1b2d19c83920fb0745c0927cc435fc6ec81de429
+verify, recover: use RepoAgent and buildcmdargs to execute Mercurial command
 
 diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
 --- a/tortoisehg/hgqt/repowidget.py
 +++ b/tortoisehg/hgqt/repowidget.py
-@@ -832,8 +832,7 @@ class RepoWidget(QWidget):
+@@ -832,8 +832,8 @@ class RepoWidget(QWidget):
          return dlg
  
      def verify(self):
 -        cmdline = ['--repository', self.repo.root, 'verify', '--verbose']
 -        dlg = cmdui.Dialog(cmdline, self)
-+        dlg = cmdui.Dialog(['verify', '--verbose'], self, self._repoagent)
++        dlg = cmdui.Dialog(hglib.buildcmdargs('verify', verbose=True),
++                           self, self._repoagent)
          dlg.setWindowIcon(qtlib.geticon('hg-verify'))
          dlg.setWindowTitle(_('%s - verify repository') % self.repo.shortname)
          dlg.setWindowFlags(dlg.windowFlags()
-@@ -843,8 +842,7 @@ class RepoWidget(QWidget):
+@@ -843,8 +843,8 @@ class RepoWidget(QWidget):
          dlg.exec_()
  
      def recover(self):
 -        cmdline = ['--repository', self.repo.root, 'recover', '--verbose']
 -        dlg = cmdui.Dialog(cmdline, self)
-+        dlg = cmdui.Dialog(['recover', '--verbose'], self, self._repoagent)
++        dlg = cmdui.Dialog(hglib.buildcmdargs('recover', verbose=True),
++                           self, self._repoagent)
          dlg.setWindowIcon(qtlib.geticon('hg-recover'))
          dlg.setWindowTitle(_('%s - recover repository') % self.repo.shortname)
          dlg.setWindowFlags(dlg.windowFlags()
 cmdcore-sessprivmeth.diff
 cmdcore-sessrunning.diff
 cmdcore-sessabort.diff
+docklog-agentren.diff
+docklog-cmdagent.diff
 docklog-useagent.diff
 repowdlg-useagent.diff
 docklogdebug.diff