changeset 974:5d45e0edfa3f

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.
author Augie Fackler <raf@durin42.com>
date Thu, 31 Dec 2015 18:48:01 -0500
parents 1f367cf5e688
children afea0e32db20
files hggit/hgrepo.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/hgrepo.py
+++ b/hggit/hgrepo.py
@@ -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)