Commits

Yuya Nishihara  committed 6ed003c

fin

  • Participants
  • Parent commits 443c256

Comments (0)

Files changed (4)

File movesig.diff

-# HG changeset patch
-# Date 1367401793 -32400
-# Parent f59bf9c7c4497f7f9821931c6023d931c60e86f6
-repowidget: group several signals which should be deprecated later
-
-They are not related to RepoWidget, but to repo itself.
-
-diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
---- a/tortoisehg/hgqt/repowidget.py
-+++ b/tortoisehg/hgqt/repowidget.py
-@@ -39,7 +39,6 @@ from PyQt4.QtGui import *
- class RepoWidget(QWidget):
- 
-     showMessageSignal = pyqtSignal(QString)
--    closeSelfSignal = pyqtSignal(QWidget)
-     toolbarVisibilityChanged = pyqtSignal()
- 
-     output = pyqtSignal(QString, QString)
-@@ -51,8 +50,11 @@ class RepoWidget(QWidget):
-     # The following signals should be exchanged directly between workbench and
-     # thgrepo. But it isn't possible because workbench cannot filter out known
-     # repo from the result of thgrepo.repository().
-+    closeSelfSignal = pyqtSignal(QWidget)
-     repoChanged = pyqtSignal(QString)
-     repoConfigChanged = pyqtSignal(QString)
-+    shortNameChanged = pyqtSignal(QString, QString)
-+    baseNodeChanged = pyqtSignal(QString, object)
- 
-     revisionSelected = pyqtSignal(object)
- 
-@@ -61,9 +63,6 @@ class RepoWidget(QWidget):
- 
-     showIcon = pyqtSignal(QIcon)
- 
--    shortNameChanged = pyqtSignal(QString, QString)
--    baseNodeChanged = pyqtSignal(QString, object)
--
-     repoLinkClicked = pyqtSignal(unicode)
-     """Emitted when clicked a link to open repository"""
- 
-uimtime.diff
-update-urlcombo.diff
-movesig.diff
 uimtime-clean.diff
 uimtime-trace.diff
 lazyrevcolor.diff

File uimtime.diff

-# HG changeset patch
-# Date 1367394223 -32400
-# Parent 21ac20843b8c68d7aefbe491a83d13a818a19e35
-thgrepo: update old uimtime only in check method
-
-Previously uimtime was remembered as propertycache and cleared by
-thginvalidate() or invalidateui(). So, it couldn't detect ui change in the
-following case:
-
- 1. "Refresh" -> thginvalidate() -> del _uimtime
- 2. touch .hg/hgrc
- 3. _checkuimtime() -> update _uimtime
-    (mtime == _uimtime but it should mtime > _uimtime)
-
-With this change, _uimtime is managed in the same manner as _repomtime, except
-for the initial value. It's initialized by the current time for simplicity.
-
-I'll remove deprecated thgrepository._uimtime later by follow-up patch.
-
-diff --git a/tortoisehg/hgqt/thgrepo.py b/tortoisehg/hgqt/thgrepo.py
---- a/tortoisehg/hgqt/thgrepo.py
-+++ b/tortoisehg/hgqt/thgrepo.py
-@@ -13,6 +13,7 @@ import sys
- import shutil
- import tempfile
- import re
-+import time
- 
- from PyQt4.QtCore import *
- 
-@@ -86,6 +87,7 @@ class ThgRepoWrapper(QObject):
-         repo.workingDirectoryChanged = self.workingDirectoryChanged
-         repo.workingBranchChanged = self.workingBranchChanged
-         self.recordState()
-+        self._uimtime = time.time()
- 
-         monitorrepo = repo.ui.config('tortoisehg', 'monitorrepo', 'always')
-         if isinstance(repo, bundlerepo.bundlerepository):
-@@ -255,10 +257,11 @@ class ThgRepoWrapper(QObject):
-     def _checkuimtime(self):
-         'Check for modified config files, or a new .hg/hgrc file'
-         try:
--            oldmtime, files = self.repo.uifiles()
--            mtime = [os.path.getmtime(f) for f in files if os.path.isfile(f)]
--            if max(mtime) > oldmtime:
-+            files = self.repo.uifiles()[1]
-+            mtime = max(os.path.getmtime(f) for f in files if os.path.isfile(f))
-+            if mtime > self._uimtime:
-                 dbgoutput('config change detected')
-+                self._uimtime = mtime
-                 self.repo.invalidateui()
-                 self.configChanged.emit()
-         except (EnvironmentError, ValueError):
-@@ -458,6 +461,7 @@ def _extendrepo(repo):
-                 heads.extend(nodes)
-             return heads
- 
-+        # TODO: remove _uimtime which is superseded by ThgRepoWrapper._uimtime
-         def uifiles(self):
-             'Returns latest mtime and complete list of config files'
-             return self._uimtime, self._uifiles

File update-urlcombo.diff

-# HG changeset patch
-# Date 1367401453 -32400
-# Parent bccf83eaed098fa9cea3e385e7925e37ab733f4b
-workbench: rebuild urlCombo if config of current tab is changed
-
-It shouldn't bother RepoWidget, but currently there's no good way to manage
-connections between thgrepo and workbench. So it reuses the design of
-repoChanged signal for now.
-
-diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
---- a/tortoisehg/hgqt/repowidget.py
-+++ b/tortoisehg/hgqt/repowidget.py
-@@ -48,7 +48,11 @@ class RepoWidget(QWidget):
-     beginSuppressPrompt = pyqtSignal()
-     endSuppressPrompt = pyqtSignal()
- 
-+    # The following signals should be exchanged directly between workbench and
-+    # thgrepo. But it isn't possible because workbench cannot filter out known
-+    # repo from the result of thgrepo.repository().
-     repoChanged = pyqtSignal(QString)
-+    repoConfigChanged = pyqtSignal(QString)
- 
-     revisionSelected = pyqtSignal(object)
- 
-@@ -1129,6 +1133,8 @@ class RepoWidget(QWidget):
-             self.shortNameChanged.emit(hglib.tounicode(self.repo.root),
-                                        self.shortname)
- 
-+        self.repoConfigChanged.emit(hglib.tounicode(self.repo.root))
-+
-     def updateTaskTabs(self):
-         val = self.repo.ui.config('tortoisehg', 'tasktabs', 'off').lower()
-         if val == 'east':
-diff --git a/tortoisehg/hgqt/workbench.py b/tortoisehg/hgqt/workbench.py
---- a/tortoisehg/hgqt/workbench.py
-+++ b/tortoisehg/hgqt/workbench.py
-@@ -401,6 +401,12 @@ class Workbench(QMainWindow):
-             else:
-                 self.urlCombo.addItem(a, (a, a))
- 
-+    #@pyqtSlot()
-+    def _setupUrlComboIfCurrent(self):
-+        w = self.repoTabsWidget.currentWidget()
-+        if self.sender() is w:
-+            self._setupUrlCombo(w.repo)
-+
-     def _syncUrlFor(self, op):
-         """Current URL alias for the given sync operation"""
-         urlindex = self.urlCombo.currentIndex()
-@@ -828,6 +834,7 @@ class Workbench(QMainWindow):
-         tw.setTabToolTip(index, hglib.tounicode(repo.root))
-         tw.setCurrentIndex(index)
-         rw.titleChanged.connect(self._updateRepoTabTitle)
-+        rw.repoConfigChanged.connect(self._setupUrlComboIfCurrent)
-         rw.showIcon.connect(
-             lambda icon: tw.setTabIcon(tw.indexOf(rw), icon))
-         self.reporegistry.addRepo(hglib.tounicode(repo.root))