Use for_branch rather than replace(revision=)
Use unicode instead of to_deprecated_string