On 7/26/19 4:08 PM, Simon Giesecke wrote:
Hi,

I needed the following patches to get hgview (with the Qt frontend) basically running on my Fedora 30 instance. Please consider merging them.


I confirm they make the QT frontend work - tested with Mercurial 4.9.

(The curses frontend is however still broken. And migration to Python 3 will very soon be necessary for Fedora packaging.)


# HG changeset patch
# User Simon Giesecke <sgiese...@mozilla.com>
# Date 1562663911 -7200
#      Tue Jul 09 11:18:31 2019 +0200
# Node ID 273b4ae25ccb8e26ca8b27b61861a621abcfb71f
# Parent  7f3142453cd546d701a7455cab9568cce08d9974
Bugfix: do not return matcher function, but use it for calling diff


Fixing a trivial recent regression for Mercurial < 5.0 from http://hg.logilab.org/review/hgview/rev/15113c412f4c .



# HG changeset patch
# User Simon Giesecke <sgiese...@mozilla.com>
# Date 1562664056 -7200
#      Tue Jul 09 11:20:56 2019 +0200
# Node ID e73ef9c7f73339207df78209f8b9ed384c166aad
# Parent  273b4ae25ccb8e26ca8b27b61861a621abcfb71f
Bugfix: status may be a QVariant


Is it known what introduced this change? Is the old behaviour still relevant?


diff --git a/hgviewlib/qt4/hgrepoviewer.py b/hgviewlib/qt4/hgrepoviewer.py
--- a/hgviewlib/qt4/hgrepoviewer.py
+++ b/hgviewlib/qt4/hgrepoviewer.py
@@ -299,6 +299,9 @@ class HgRepoViewer(ActionsMixin, HgDialo
             else:
                 try:
                     status = int(status)
+                except TypeError:
+                    # assume status is a QVariant
+                    status = int(status.toBool())
                 except ValueError:
                     # for backward compatibility
                     status = {'false': False , 'true': True}.get(status.lower(), status)


Instead of catching the generic TypeError, how about something like:

             status = settings.value(entryname)
             if status is None:
                 status = 1
+            elif isinstance(status, QtCore.QVariant):
+                status = int(status.toBool())
             else:
                 try:
                     status = int(status)


Thanks,
Mads,
Fedora packager.

_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
https://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to