Minor nit, but it looks like the existing space before the branch name was lost. And it would probably be a little more readable if there was a space between the branch name and (closed).
I had assumed from the bug report that the request was to annotate each closed branch as closed, so I interpreted the output incorrectly. It might be too much output to put (closed) after each closed branch in the list if it is long. But maybe "(%d closed)" % len(closedbranches) will make it less ambiguous? See what others think.
Nice work, I have left some inline comments. Can you also add a test where we pushing multiple branches and not every branch is a closed branch?
How about having this as a set so that we don't need to convert it later.
if isclosed will work.
No need to convert closedbranches back to list.
if closedbranches will work here.