obslog: cleanup patch handling after 4.1 compat drop
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 22 Mar 2018 10:34:44 +0100
changeset 3604 d24ba168a532
parent 3603 986867000521
child 3605 f60afeb28192
obslog: cleanup patch handling after 4.1 compat drop We can remove some of your compatibility code.
hgext3rd/evolve/obshistory.py
--- a/hgext3rd/evolve/obshistory.py	Thu Mar 22 10:25:01 2018 +0100
+++ b/hgext3rd/evolve/obshistory.py	Thu Mar 22 10:34:44 2018 +0100
@@ -172,15 +172,11 @@
     succname = "changeset-description"
 
     d = compat.strdiff(basedesc, succdesc, basename, succname)
-    # mercurial 4.1 and before return the patch directly
-    if not isinstance(d, tuple):
-        patch = d
-    else:
-        uheaders, hunks = d
+    uheaders, hunks = d
 
-        # Copied from patch.diff
-        text = ''.join(sum((list(hlines) for hrange, hlines in hunks), []))
-        patch = "\n".join(uheaders + [text])
+    # Copied from patch.diff
+    text = ''.join(sum((list(hlines) for hrange, hlines in hunks), []))
+    patch = "\n".join(uheaders + [text])
 
     return patch