changeset 13180:a79e0688a5ee

subrepo: fix git archive parsing of directories and symfiles
author Eric Eisner <ede@mit.edu>
date Mon, 20 Dec 2010 13:59:33 -0500
parents b512a7074349
children 413bef846806
files mercurial/subrepo.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)