branchmap: use a context manager when writing the branchmap
This is cleaner and safer. The previous code date from long before we had
context manager available.
from mercurial.i18n import _
from mercurial import changegroup, error, extensions
def abort(orig, *args, **kwargs):
raise error.Abort(_('this is an exercise'))
def uisetup(ui):
extensions.wrapfunction(changegroup, 'getbundler', abort)