##// END OF EJS Templates
archive: always use portable path component separators with subrepos...
Matt Harbison -
r24924:41cd8171 stable
parent child Browse files
Show More
@@ -517,7 +517,7 b' class abstractsubrepo(object):'
517 flags = self.fileflags(name)
517 flags = self.fileflags(name)
518 mode = 'x' in flags and 0755 or 0644
518 mode = 'x' in flags and 0755 or 0644
519 symlink = 'l' in flags
519 symlink = 'l' in flags
520 archiver.addfile(self.wvfs.reljoin(prefix, self._path, name),
520 archiver.addfile(prefix + self._path + '/' + name,
521 mode, symlink, self.filedata(name))
521 mode, symlink, self.filedata(name))
522 self.ui.progress(_('archiving (%s)') % relpath, i + 1,
522 self.ui.progress(_('archiving (%s)') % relpath, i + 1,
523 unit=_('files'), total=total)
523 unit=_('files'), total=total)
@@ -731,8 +731,7 b' class hgsubrepo(abstractsubrepo):'
731 for subpath in ctx.substate:
731 for subpath in ctx.substate:
732 s = subrepo(ctx, subpath)
732 s = subrepo(ctx, subpath)
733 submatch = matchmod.narrowmatcher(subpath, match)
733 submatch = matchmod.narrowmatcher(subpath, match)
734 total += s.archive(
734 total += s.archive(archiver, prefix + self._path + '/', submatch)
735 archiver, self.wvfs.reljoin(prefix, self._path), submatch)
736 return total
735 return total
737
736
738 @annotatesubrepoerror
737 @annotatesubrepoerror
@@ -1675,7 +1674,7 b' class gitsubrepo(abstractsubrepo):'
1675 data = info.linkname
1674 data = info.linkname
1676 else:
1675 else:
1677 data = tar.extractfile(info).read()
1676 data = tar.extractfile(info).read()
1678 archiver.addfile(self.wvfs.reljoin(prefix, self._path, info.name),
1677 archiver.addfile(prefix + self._path + '/' + info.name,
1679 info.mode, info.issym(), data)
1678 info.mode, info.issym(), data)
1680 total += 1
1679 total += 1
1681 self.ui.progress(_('archiving (%s)') % relpath, i + 1,
1680 self.ui.progress(_('archiving (%s)') % relpath, i + 1,
@@ -309,21 +309,17 b' Exclude large files from main and sub-su'
309
309
310 Exclude normal files from main and sub-sub repo
310 Exclude normal files from main and sub-sub repo
311
311
312 $ hg --config extensions.largefiles= archive -S -X '**.txt' ../archive_lf
312 $ hg --config extensions.largefiles= archive -S -X '**.txt' ../archive_lf.tgz
313 $ find ../archive_lf | sort
313 $ tar -tzf ../archive_lf.tgz | sort
314 ../archive_lf
314 archive_lf/.hgsub
315 ../archive_lf/.hgsub
315 archive_lf/.hgsubstate
316 ../archive_lf/.hgsubstate
316 archive_lf/large.bin
317 ../archive_lf/large.bin
317 archive_lf/main
318 ../archive_lf/main
318 archive_lf/sub1/.hgsub
319 ../archive_lf/sub1
319 archive_lf/sub1/.hgsubstate
320 ../archive_lf/sub1/.hgsub
320 archive_lf/sub1/sub1
321 ../archive_lf/sub1/.hgsubstate
321 archive_lf/sub1/sub2/large.bin
322 ../archive_lf/sub1/sub1
322 archive_lf/sub1/sub2/sub2
323 ../archive_lf/sub1/sub2
324 ../archive_lf/sub1/sub2/large.bin
325 ../archive_lf/sub1/sub2/sub2
326 $ rm -rf ../archive_lf
327
323
328 Include normal files from within a largefiles subrepo
324 Include normal files from within a largefiles subrepo
329
325
@@ -325,6 +325,14 b' archive subrepos'
325 ../archive_x/s
325 ../archive_x/s
326 ../archive_x/s/g
326 ../archive_x/s/g
327
327
328 $ hg -R ../tc archive -S ../archive.tgz 2>/dev/null
329 $ tar -tzf ../archive.tgz | sort
330 archive/.hg_archival.txt
331 archive/.hgsub
332 archive/.hgsubstate
333 archive/a
334 archive/s/g
335
328 create nested repo
336 create nested repo
329
337
330 $ cd ..
338 $ cd ..
@@ -434,6 +434,18 b" Note there's a slight output glitch on n"
434 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
434 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
435 #endif
435 #endif
436
436
437 Archive + subrepos uses '/' for all component separators
438
439 $ tar -tzf ../archive.tar.gz | sort
440 archive/.hg_archival.txt
441 archive/.hgsub
442 archive/.hgsubstate
443 archive/foo/.hgsub
444 archive/foo/.hgsubstate
445 archive/foo/bar/z.txt
446 archive/foo/y.txt
447 archive/x.txt
448
437 The newly cloned subrepos contain no working copy:
449 The newly cloned subrepos contain no working copy:
438
450
439 $ hg -R foo summary
451 $ hg -R foo summary
General Comments 0
You need to be logged in to leave comments. Login now