Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 17441:cb12d3ce5607 stable
subrepo: encode unicode path names (issue3610)
Subversion 1.7 changes its XML output to include an explicit encoding tag:
<?xml version="1.0" encoding="UTF-8"?>
This triggers xml.dom.minidom to always return unicode strings, causing
other parts of the code to explode.
We unconditionally encode path names before handing them back, which
works with both str (actually a no-op) and unicode values.
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Tue, 04 Sep 2012 15:46:04 -0700 |
parents | 5884812686f7 |
children | 1526ac765e29 6929b9c70be9 |
comparison
equal
deleted
inserted
replaced
17374:0cec762790ed | 17441:cb12d3ce5607 |
---|---|
836 if kind != 'file': | 836 if kind != 'file': |
837 continue | 837 continue |
838 name = ''.join(c.data for c | 838 name = ''.join(c.data for c |
839 in e.getElementsByTagName('name')[0].childNodes | 839 in e.getElementsByTagName('name')[0].childNodes |
840 if c.nodeType == c.TEXT_NODE) | 840 if c.nodeType == c.TEXT_NODE) |
841 paths.append(name) | 841 paths.append(name.encode('utf-8')) |
842 return paths | 842 return paths |
843 | 843 |
844 def filedata(self, name): | 844 def filedata(self, name): |
845 return self._svncommand(['cat'], name)[0] | 845 return self._svncommand(['cat'], name)[0] |
846 | 846 |