Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 16451:9c431cfdca12
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 16 Apr 2012 16:50:25 -0500 |
parents | 6883c2363f44 c9c8c9053119 |
children | 2fb521d75dc2 |
comparison
equal
deleted
inserted
replaced
16449:874a680a3e23 | 16451:9c431cfdca12 |
---|---|
784 def push(self, opts): | 784 def push(self, opts): |
785 # push is a no-op for SVN | 785 # push is a no-op for SVN |
786 return True | 786 return True |
787 | 787 |
788 def files(self): | 788 def files(self): |
789 output = self._svncommand(['list']) | 789 output = self._svncommand(['list', '--recursive', '--xml'])[0] |
790 # This works because svn forbids \n in filenames. | 790 doc = xml.dom.minidom.parseString(output) |
791 return output.splitlines() | 791 paths = [] |
792 for e in doc.getElementsByTagName('entry'): | |
793 kind = str(e.getAttribute('kind')) | |
794 if kind != 'file': | |
795 continue | |
796 name = ''.join(c.data for c | |
797 in e.getElementsByTagName('name')[0].childNodes | |
798 if c.nodeType == c.TEXT_NODE) | |
799 paths.append(name) | |
800 return paths | |
792 | 801 |
793 def filedata(self, name): | 802 def filedata(self, name): |
794 return self._svncommand(['cat'], name) | 803 return self._svncommand(['cat'], name)[0] |
795 | 804 |
796 | 805 |
797 class gitsubrepo(abstractsubrepo): | 806 class gitsubrepo(abstractsubrepo): |
798 def __init__(self, ctx, path, state): | 807 def __init__(self, ctx, path, state): |
799 # TODO add git version check. | 808 # TODO add git version check. |