Commits

Yuya Nishihara committed 52b0fcf

thgrepo patches (experimental)

Comments (0)

Files changed (4)

repolesswatch.diff

+# HG changeset patch
+# Parent a57af60e893a3ad71f5100255ceda75f514fa98c
+
+diff --git a/tortoisehg/hgqt/thgrepo.py b/tortoisehg/hgqt/thgrepo.py
+--- a/tortoisehg/hgqt/thgrepo.py
++++ b/tortoisehg/hgqt/thgrepo.py
+@@ -187,22 +187,27 @@ class RepoWatcher(QObject):
+             return None
+ 
+     def _getwatchedfiles(self):
++        'Repository files which may be modified without locking'
++        watchedfiles = []
++        if hasattr(self.repo, 'mq'):
++            watchedfiles.append(self.repo.mq.join('series'))
++            watchedfiles.append(self.repo.mq.join('guards'))
++            watchedfiles.append(self.repo.join('patches.queue'))
++        return watchedfiles
++
++    def _getrepofiles(self):
+         watchedfiles = [self.repo.sjoin('00changelog.i')]
+         watchedfiles.append(self.repo.sjoin('phaseroots'))
+         watchedfiles.append(self.repo.join('localtags'))
+         # no need to watch 'bookmarks' because repo._bookmarks.write touches
+         # 00changelog.i (see bookmarks.bmstore.write)
+         watchedfiles.append(self.repo.join('bookmarks.current'))
+-        if hasattr(self.repo, 'mq'):
+-            watchedfiles.append(self.repo.mq.join('series'))
+-            watchedfiles.append(self.repo.mq.join('guards'))
+-            watchedfiles.append(self.repo.join('patches.queue'))
+-        return watchedfiles
++        return watchedfiles + self._getwatchedfiles()
+ 
+     def _getrepomtime(self):
+         'Return the last modification time for the repo'
+         try:
+-            existing = [f for f in self._getwatchedfiles() if os.path.exists(f)]
++            existing = [f for f in self._getrepofiles() if os.path.exists(f)]
+             mtime = [os.path.getmtime(wf) for wf in existing]
+             if mtime:
+                 return max(mtime)

reponoisfile.diff

+# HG changeset patch
+# Parent 49b60be57c79e8be61f1bf5be7f49784181145b8
+
+diff --git a/tortoisehg/hgqt/thgrepo.py b/tortoisehg/hgqt/thgrepo.py
+--- a/tortoisehg/hgqt/thgrepo.py
++++ b/tortoisehg/hgqt/thgrepo.py
+@@ -133,7 +133,7 @@ class RepoWatcher(QObject):
+ 
+     def addMissingPaths(self):
+         'Add files to watcher that may have been added or replaced'
+-        existing = [f for f in self._getwatchedfiles() if os.path.isfile(f)]
++        existing = [f for f in self._getwatchedfiles() if os.path.exists(f)]
+         files = [unicode(f) for f in self._fswatcher.files()]
+         for f in existing:
+             if hglib.tounicode(f) not in files:
+@@ -194,7 +194,6 @@ class RepoWatcher(QObject):
+         # 00changelog.i (see bookmarks.bmstore.write)
+         watchedfiles.append(self.repo.join('bookmarks.current'))
+         if hasattr(self.repo, 'mq'):
+-            watchedfiles.append(self.repo.mq.path)
+             watchedfiles.append(self.repo.mq.join('series'))
+             watchedfiles.append(self.repo.mq.join('guards'))
+             watchedfiles.append(self.repo.join('patches.queue'))
+@@ -203,7 +202,7 @@ class RepoWatcher(QObject):
+     def _getrepomtime(self):
+         'Return the last modification time for the repo'
+         try:
+-            existing = [f for f in self._getwatchedfiles() if os.path.isfile(f)]
++            existing = [f for f in self._getwatchedfiles() if os.path.exists(f)]
+             mtime = [os.path.getmtime(wf) for wf in existing]
+             if mtime:
+                 return max(mtime)

repostatonce.diff

+# HG changeset patch
+# Parent 9af612ad24193896ab8fbfeefa1eae0beaf7f4e5
+
+diff --git a/tortoisehg/hgqt/thgrepo.py b/tortoisehg/hgqt/thgrepo.py
+--- a/tortoisehg/hgqt/thgrepo.py
++++ b/tortoisehg/hgqt/thgrepo.py
+@@ -206,13 +206,14 @@ class RepoWatcher(QObject):
+ 
+     def _getrepomtime(self):
+         'Return the last modification time for the repo'
+-        try:
+-            existing = [f for f in self._getrepofiles() if os.path.exists(f)]
+-            mtime = [os.path.getmtime(wf) for wf in existing]
+-            if mtime:
+-                return max(mtime)
+-        except EnvironmentError:
+-            return None
++        mtime = []
++        for f in self._getrepofiles():
++            try:
++                mtime.append(os.path.getmtime(f))
++            except EnvironmentError:
++                pass
++        if mtime:
++            return max(mtime)
+ 
+     def _checkrepotime(self):
+         'Check for new changelog entries, or MQ status changes'
+reponoisfile.diff
+repolesswatch.diff
+repostatonce.diff
 serve-usecmda.diff
 serve-useproc.diff
 cmdui-useagent.diff