Fix bug in prettyDiffEntry output

It was not handling adding or removing modules correctly.
This commit is contained in:
Brian C. Lane 2018-03-14 14:05:47 -07:00
parent aa076ee53b
commit d0676dbf7c

View File

@ -223,8 +223,14 @@ def prettyDiffEntry(diff):
else:
return "Unknown"
elif change(diff) == "Added":
if name(diff) in ["Module", "Package"]:
return "%s %s" % (diff["new"][name(diff)]["name"], diff["new"][name(diff)]["version"])
else:
return " ".join([diff["new"][k] for k in diff["new"]])
elif change(diff) == "Removed":
if name(diff) in ["Module", "Package"]:
return "%s %s" % (diff["old"][name(diff)]["name"], diff["old"][name(diff)]["version"])
else:
return " ".join([diff["old"][k] for k in diff["old"]])
return change(diff) + " " + name(diff) + " " + details(diff)