changeset 2592:fb33d856d25e

compat: make obshistory._getdifflines compatible with mercurial 4.1 On Mercurial version 4.1 and lower, patch.diff seems to returns an empty list when there is no change. Mercurial 4.2 returns None so we add a if for this case.
author Boris Feld <boris.feld@octobus.net>
date Thu, 15 Jun 2017 20:40:07 +0200
parents 1991935fb603
children ed977325cd2a
files hgext3rd/evolve/obshistory.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/obshistory.py	Fri Jun 09 00:52:54 2017 +0100
+++ b/hgext3rd/evolve/obshistory.py	Thu Jun 15 20:40:07 2017 +0200
@@ -484,6 +484,9 @@
 def _getdifflines(iterdiff):
     """return a cleaned up lines"""
     try:
+        # XXX-COMPAT Mercurial 4.1 compat
+        if isinstance(iterdiff, list) and len(iterdiff) == 0:
+            return None
         lines = iterdiff.next()
     except StopIteration:
         return None