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.
--- 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