Mercurial > evolve
changeset 3604:d24ba168a532
obslog: cleanup patch handling after 4.1 compat drop
We can remove some of your compatibility code.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 22 Mar 2018 10:34:44 +0100 |
parents | 986867000521 |
children | f60afeb28192 |
files | hgext3rd/evolve/obshistory.py |
diffstat | 1 files changed, 4 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- 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