Mercurial > hg
changeset 16451:9c431cfdca12
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 16 Apr 2012 16:50:25 -0500 |
parents | 874a680a3e23 (current diff) c9c8c9053119 (diff) |
children | 8a72805034d5 |
files | mercurial/subrepo.py tests/test-subrepo-svn.t |
diffstat | 2 files changed, 26 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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):
--- a/tests/test-subrepo-svn.t Sun Apr 15 16:05:57 2012 +0200 +++ b/tests/test-subrepo-svn.t Mon Apr 16 16:50:25 2012 -0500 @@ -535,3 +535,16 @@ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ test -f recreated/somethingold +Test archive + + $ hg archive -S ../archive-all --debug + archiving: 0/2 files (0.00%) + archiving: .hgsub 1/2 files (50.00%) + archiving: .hgsubstate 2/2 files (100.00%) + archiving (obstruct): 0/1 files (0.00%) + archiving (obstruct): 1/1 files (100.00%) + archiving (s): 0/2 files (0.00%) + archiving (s): 1/2 files (50.00%) + archiving (s): 2/2 files (100.00%) + archiving (recreated): 0/1 files (0.00%) + archiving (recreated): 1/1 files (100.00%)