def checkportable(ui, f):
    """Check if filename f is portable and warn or abort depending on config"""
    checkfilename(f)
    abort, warn = checkportabilityalert(ui)
    if abort or warn:
        msg = winutil.checkwinfilename(f)
        if msg:
            msg = "%s: %s" % (msg, util.shellquote(f))
            if abort:
                raise error.Abort(msg)
            ui.warn(_("%s\n") % msg, notice=_("warning"))