##// 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 517 flags = self.fileflags(name)
518 518 mode = 'x' in flags and 0755 or 0644
519 519 symlink = 'l' in flags
520 archiver.addfile(self.wvfs.reljoin(prefix, self._path, name),
520 archiver.addfile(prefix + self._path + '/' + name,
521 521 mode, symlink, self.filedata(name))
522 522 self.ui.progress(_('archiving (%s)') % relpath, i + 1,
523 523 unit=_('files'), total=total)
@@ -731,8 +731,7 b' class hgsubrepo(abstractsubrepo):'
731 731 for subpath in ctx.substate:
732 732 s = subrepo(ctx, subpath)
733 733 submatch = matchmod.narrowmatcher(subpath, match)
734 total += s.archive(
735 archiver, self.wvfs.reljoin(prefix, self._path), submatch)
734 total += s.archive(archiver, prefix + self._path + '/', submatch)
736 735 return total
737 736
738 737 @annotatesubrepoerror
@@ -1675,7 +1674,7 b' class gitsubrepo(abstractsubrepo):'
1675 1674 data = info.linkname
1676 1675 else:
1677 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 1678 info.mode, info.issym(), data)
1680 1679 total += 1
1681 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 310 Exclude normal files from main and sub-sub repo
311 311
312 $ hg --config extensions.largefiles= archive -S -X '**.txt' ../archive_lf
313 $ find ../archive_lf | sort
314 ../archive_lf
315 ../archive_lf/.hgsub
316 ../archive_lf/.hgsubstate
317 ../archive_lf/large.bin
318 ../archive_lf/main
319 ../archive_lf/sub1
320 ../archive_lf/sub1/.hgsub
321 ../archive_lf/sub1/.hgsubstate
322 ../archive_lf/sub1/sub1
323 ../archive_lf/sub1/sub2
324 ../archive_lf/sub1/sub2/large.bin
325 ../archive_lf/sub1/sub2/sub2
326 $ rm -rf ../archive_lf
312 $ hg --config extensions.largefiles= archive -S -X '**.txt' ../archive_lf.tgz
313 $ tar -tzf ../archive_lf.tgz | sort
314 archive_lf/.hgsub
315 archive_lf/.hgsubstate
316 archive_lf/large.bin
317 archive_lf/main
318 archive_lf/sub1/.hgsub
319 archive_lf/sub1/.hgsubstate
320 archive_lf/sub1/sub1
321 archive_lf/sub1/sub2/large.bin
322 archive_lf/sub1/sub2/sub2
327 323
328 324 Include normal files from within a largefiles subrepo
329 325
@@ -325,6 +325,14 b' archive subrepos'
325 325 ../archive_x/s
326 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 336 create nested repo
329 337
330 338 $ cd ..
@@ -434,6 +434,18 b" Note there's a slight output glitch on n"
434 434 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
435 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 449 The newly cloned subrepos contain no working copy:
438 450
439 451 $ hg -R foo summary
General Comments 0
You need to be logged in to leave comments. Login now