##// END OF EJS Templates
archive: make it work with svn subrepos (issue3308)...
Patrick Mezard -
r16450:c9c8c905 stable
parent child Browse files
Show More
@@ -740,12 +740,21 b' class svnsubrepo(abstractsubrepo):'
740 return True
740 return True
741
741
742 def files(self):
742 def files(self):
743 output = self._svncommand(['list'])
743 output = self._svncommand(['list', '--recursive', '--xml'])[0]
744 # This works because svn forbids \n in filenames.
744 doc = xml.dom.minidom.parseString(output)
745 return output.splitlines()
745 paths = []
746 for e in doc.getElementsByTagName('entry'):
747 kind = str(e.getAttribute('kind'))
748 if kind != 'file':
749 continue
750 name = ''.join(c.data for c
751 in e.getElementsByTagName('name')[0].childNodes
752 if c.nodeType == c.TEXT_NODE)
753 paths.append(name)
754 return paths
746
755
747 def filedata(self, name):
756 def filedata(self, name):
748 return self._svncommand(['cat'], name)
757 return self._svncommand(['cat'], name)[0]
749
758
750
759
751 class gitsubrepo(abstractsubrepo):
760 class gitsubrepo(abstractsubrepo):
@@ -543,3 +543,16 b' First, create that condition in the repo'
543 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
543 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
544 $ test -f recreated/somethingold
544 $ test -f recreated/somethingold
545
545
546 Test archive
547
548 $ hg archive -S ../archive-all --debug
549 archiving: 0/2 files (0.00%)
550 archiving: .hgsub 1/2 files (50.00%)
551 archiving: .hgsubstate 2/2 files (100.00%)
552 archiving (obstruct): 0/1 files (0.00%)
553 archiving (obstruct): 1/1 files (100.00%)
554 archiving (s): 0/2 files (0.00%)
555 archiving (s): 1/2 files (50.00%)
556 archiving (s): 2/2 files (100.00%)
557 archiving (recreated): 0/1 files (0.00%)
558 archiving (recreated): 1/1 files (100.00%)
General Comments 0
You need to be logged in to leave comments. Login now