patch: catch unexpected case in _inlinediff
If operation is neither 'diff.inserted' or 'diff.deleted', label and token won't
be define. This patch explicitely catches that exception.
--- a/mercurial/patch.py Fri Dec 08 16:47:18 2017 +0900
+++ b/mercurial/patch.py Fri Dec 08 16:54:59 2017 +0900
@@ -2575,6 +2575,9 @@
token = '+'
s2 = s2[1:]
s1 = s1[1:]
+ else:
+ raise error.ProgrammingError("Case not expected, operation = %s" %
+ operation)
s = difflib.ndiff(re.split(br'(\W)', s2), re.split(br'(\W)', s1))
for part in s: