# HG changeset patch # User Augie Fackler # Date 1451605681 18000 # Node ID 5d45e0edfa3fe15f2892c77ba8a727550eca0b82 # Parent 1f367cf5e68851b113079f53371d905fa049b9ed hgrepo: ensure all git-origin tags are bytes If we don't do this we might end up with unicodes being written using ui, which then breaks in popbuffer in test-encoding.t. This appears to be an academic concern until we start passing unicode paths to git repos, which we need to do in order to resolve some other problems. Yay. diff -r 1f367cf5e688 -r 5d45e0edfa3f hggit/hgrepo.py --- a/hggit/hgrepo.py Mon Dec 07 19:59:17 2015 -0500 +++ b/hggit/hgrepo.py Thu Dec 31 18:48:01 2015 -0500 @@ -45,9 +45,15 @@ (tags, tagtypes) = super(hgrepo, self)._findtags() for tag, rev in self.githandler.tags.iteritems(): + if isinstance(tag, unicode): + tag = tag.encode('utf-8') tags[tag] = bin(rev) tagtypes[tag] = 'git' - + for tag, rev in self.githandler.remote_refs.iteritems(): + if isinstance(tag, unicode): + tag = tag.encode('utf-8') + tags[tag] = rev + tagtypes[tag] = 'git-remote' tags.update(self.githandler.remote_refs) return (tags, tagtypes)