[PATCH 1 of 2 stable] workbench: reload MQ dock on manual refresh (refs #3274)

12 views
Skip to first unread message

Yuya Nishihara

unread,
Aug 11, 2013, 5:17:38 AM8/11/13
to thg...@googlegroups.com
# HG changeset patch
# User Yuya Nishihara <yu...@tcha.org>
# Date 1376207467 -32400
# Sun Aug 11 16:51:07 2013 +0900
# Branch stable
# Node ID dc741e5a657f6cad7b14d2fe4abbbf5b2c2077c1
# Parent d772a6fe5bbf645cf37ffa98056a722525288601
workbench: reload MQ dock on manual refresh (refs #3274)

Otherwise there is no obvious way to update stale MQPatchesWidget.

diff --git a/tortoisehg/hgqt/workbench.py b/tortoisehg/hgqt/workbench.py
--- a/tortoisehg/hgqt/workbench.py
+++ b/tortoisehg/hgqt/workbench.py
@@ -970,6 +970,9 @@ class Workbench(QMainWindow):
getattr(w, 'reload')()
self._setupUrlCombo(w.repo)

+ if not self.mqpatches.isHidden():
+ self.mqpatches.reload()
+
@pyqtSlot(QAction)
def _runSyncAction(self, action):
w = self.repoTabsWidget.currentWidget()

Yuya Nishihara

unread,
Aug 11, 2013, 5:17:39 AM8/11/13
to thg...@googlegroups.com
# HG changeset patch
# User Yuya Nishihara <yu...@tcha.org>
# Date 1376211495 -32400
# Sun Aug 11 17:58:15 2013 +0900
# Branch stable
# Node ID 89c3f499c0105969802ac33209c69072c4bb0109
# Parent dc741e5a657f6cad7b14d2fe4abbbf5b2c2077c1
thgrepo: recreate QFileSystemWatcher to restart monitoring (fixes #3298)

QWindowsFileSystemWatcherEngine seems to have a bug which makes monitoring
of ".hg" and ".hg/store" directory not restartable. After that, it cannot
detect deletion of lock files.

https://bugreports.qt-project.org/browse/QTBUG-32917

diff --git a/tortoisehg/hgqt/thgrepo.py b/tortoisehg/hgqt/thgrepo.py
--- a/tortoisehg/hgqt/thgrepo.py
+++ b/tortoisehg/hgqt/thgrepo.py
@@ -108,6 +108,14 @@ class RepoWatcher(QObject):
if files:
self._fswatcher.removePaths(files)

+ # QTBUG-32917: On Windows, removePaths() fails to remove ".hg" and
+ # ".hg/store" from the list, but actually they are not watched.
+ # Thus, they cannot be watched again by the same fswatcher instance.
+ if self._fswatcher.directories() or self._fswatcher.files():
+ dbgoutput('failed to remove paths - destroying watcher')
+ self._fswatcher.setParent(None)
+ self._fswatcher = None
+
def isMonitoring(self):
"""True if filesystem monitor is running"""
if not self._fswatcher:

Steve Borho

unread,
Aug 12, 2013, 7:49:15 AM8/12/13
to thg...@googlegroups.com
On Sun, Aug 11, 2013 at 4:17 AM, Yuya Nishihara <yu...@tcha.org> wrote:
# HG changeset patch
# User Yuya Nishihara <yu...@tcha.org>
# Date 1376211495 -32400
#      Sun Aug 11 17:58:15 2013 +0900
# Branch stable
# Node ID 89c3f499c0105969802ac33209c69072c4bb0109
# Parent  dc741e5a657f6cad7b14d2fe4abbbf5b2c2077c1
thgrepo: recreate QFileSystemWatcher to restart monitoring (fixes #3298)

QWindowsFileSystemWatcherEngine seems to have a bug which makes monitoring
of ".hg" and ".hg/store" directory not restartable. After that, it cannot
detect deletion of lock files.

that is unfortunate, pushed to stable
 
https://bugreports.qt-project.org/browse/QTBUG-32917

Nice bug report.
 


diff --git a/tortoisehg/hgqt/thgrepo.py b/tortoisehg/hgqt/thgrepo.py
--- a/tortoisehg/hgqt/thgrepo.py
+++ b/tortoisehg/hgqt/thgrepo.py
@@ -108,6 +108,14 @@ class RepoWatcher(QObject):
         if files:
             self._fswatcher.removePaths(files)

+        # QTBUG-32917: On Windows, removePaths() fails to remove ".hg" and
+        # ".hg/store" from the list, but actually they are not watched.
+        # Thus, they cannot be watched again by the same fswatcher instance.
+        if self._fswatcher.directories() or self._fswatcher.files():
+            dbgoutput('failed to remove paths - destroying watcher')
+            self._fswatcher.setParent(None)
+            self._fswatcher = None
+
     def isMonitoring(self):
         """True if filesystem monitor is running"""
         if not self._fswatcher:

--
You received this message because you are subscribed to the Google Groups "TortoiseHg Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thg-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
Steve Borho
Reply all
Reply to author
Forward
0 new messages