diff tests/test-largefiles.t @ 16578:43fb170a23bd

largefiles: make archive -S store largefiles instead of standins This is essentially a copy of largefile's override of archive() in the archival class, adapted for overriding hgsubrepo's archive(). That means decoding isn't taken into consideration, nor is .hg_archival.txt generated (the same goes for regular subrepos). Unlike subrepos, but consistent with largefile's handling of the top repo, ui.progress() is *not* called. This should probably be refactored at some point, but at least this generates the archives properly for now. Previously, the standins were ignored and the largefiles were archived only for the top level repo. Long term, it would probably be most desirable to figure out how to tweak archival's archive() if necessary such that largefiles doesn't need to override it completely just to special case the translating of standins to the real files. Largefiles will already return a context with the true largefiles instead of the standins if lfilesrepo's lfstatus is True- perhaps this can be leveraged?
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 03 May 2012 21:32:57 -0400
parents bb3334806ace
children 80da0352a037
line wrap: on
line diff
--- a/tests/test-largefiles.t	Thu May 03 16:12:52 2012 -0500
+++ b/tests/test-largefiles.t	Thu May 03 21:32:57 2012 -0400
@@ -1096,4 +1096,34 @@
   abort: uncommitted changes in subrepo subrepo
   (use --subrepos for recursive commit)
   [255]
+
+# Add a normal file to the subrepo, then test archiving
+  $ echo 'normal file' > subrepo/normal.txt
+  $ hg -R subrepo add subrepo/normal.txt
+# Lock in subrepo, otherwise the change isn't archived
+  $ hg ci -S -m "add normal file to top level"
+  committing subrepository subrepo
+  Invoking status precommit hook
+  M large.txt
+  A normal.txt
+  Invoking status precommit hook
+  M .hgsubstate
+  $ hg archive -S lf_subrepo_archive
+  $ find lf_subrepo_archive -print
+  lf_subrepo_archive
+  lf_subrepo_archive/.hg_archival.txt
+  lf_subrepo_archive/.hgsubstate
+  lf_subrepo_archive/subrepo
+  lf_subrepo_archive/subrepo/large.txt
+  lf_subrepo_archive/subrepo/normal.txt
+  lf_subrepo_archive/a
+  lf_subrepo_archive/a/b
+  lf_subrepo_archive/a/b/c
+  lf_subrepo_archive/a/b/c/d
+  lf_subrepo_archive/a/b/c/d/e.normal.txt
+  lf_subrepo_archive/a/b/c/d/e.large.txt
+  lf_subrepo_archive/a/b/c/x
+  lf_subrepo_archive/a/b/c/x/y.normal.txt
+  lf_subrepo_archive/.hgsub
+
   $ cd ..