subrepo: fix git archive parsing of directories and symfiles
authorEric Eisner <ede@mit.edu>
Mon, 20 Dec 2010 13:59:33 -0500
changeset 13180 a79e0688a5ee
parent 13179 b512a7074349
child 13181 413bef846806
subrepo: fix git archive parsing of directories and symfiles
mercurial/subrepo.py
--- a/mercurial/subrepo.py	Mon Dec 20 13:59:33 2010 -0500
+++ b/mercurial/subrepo.py	Mon Dec 20 13:59:33 2010 -0500
@@ -886,9 +886,14 @@
         relpath = subrelpath(self)
         ui.progress(_('archiving (%s)') % relpath, 0, unit=_('files'))
         for i, info in enumerate(tar):
+            if info.isdir():
+                continue
+            if info.issym():
+                data = info.linkname
+            else:
+                data = tar.extractfile(info).read()
             archiver.addfile(os.path.join(prefix, self._relpath, info.name),
-                             info.mode, info.issym(),
-                             tar.extractfile(info).read())
+                             info.mode, info.issym(), data)
             ui.progress(_('archiving (%s)') % relpath, i + 1,
                         unit=_('files'))
         ui.progress(_('archiving (%s)') % relpath, None)