mercurial/subrepo.py
changeset 16451 9c431cfdca12
parent 16430 6883c2363f44
parent 16450 c9c8c9053119
child 16468 2fb521d75dc2
--- a/mercurial/subrepo.py	Sun Apr 15 16:05:57 2012 +0200
+++ b/mercurial/subrepo.py	Mon Apr 16 16:50:25 2012 -0500
@@ -786,12 +786,21 @@
         return True
 
     def files(self):
-        output = self._svncommand(['list'])
-        # This works because svn forbids \n in filenames.
-        return output.splitlines()
+        output = self._svncommand(['list', '--recursive', '--xml'])[0]
+        doc = xml.dom.minidom.parseString(output)
+        paths = []
+        for e in doc.getElementsByTagName('entry'):
+            kind = str(e.getAttribute('kind'))
+            if kind != 'file':
+                continue
+            name = ''.join(c.data for c
+                           in e.getElementsByTagName('name')[0].childNodes
+                           if c.nodeType == c.TEXT_NODE)
+            paths.append(name)
+        return paths
 
     def filedata(self, name):
-        return self._svncommand(['cat'], name)
+        return self._svncommand(['cat'], name)[0]
 
 
 class gitsubrepo(abstractsubrepo):