diff tests/test-kwarchive.t @ 288:0080dab59fac

Begin tests with subrepos and some preparations for nested subrepos
author Franz Glasner <hg@dom66.de>
date Thu, 17 Jan 2019 09:38:19 +0100
parents 9a3dacfc3be6
children 986d1472580c
line wrap: on
line diff
--- a/tests/test-kwarchive.t	Wed Jan 16 21:18:49 2019 +0100
+++ b/tests/test-kwarchive.t	Thu Jan 17 09:38:19 2019 +0100
@@ -269,3 +269,74 @@
   __revision__ = "$Revision: 8c27876b7952 $"
   __author__ = "Franz Glasner"
    (?)
+
+  $ cd ..
+
+Archiving with subrepos
+
+  $ prepare_repo "repo2"
+  $ cd "repo2"
+  $ prepare_subrepo "subrepo1"
+  $ echo `pwd`
+  $TESTTMP/repo2
+  $ cat .hgsubstate
+  ^[a-f0-9]+\s+subrepo1$ (re)
+
+... archiving subrepos does not automatically anything expand in the subrepos
+
+  $ hg kwarchive -S --path-filter=full --user-filter=full _archive
+  $ cat _archive/subrepo1/test2.txt
+  test2.txt: This is a file with some replacement tests
+  ^$ (re)
+  $HGheader$
+  $HGnodeid$
+  $Date$
+  $JustDate$
+  $HGrevision$
+  $Revision$
+  $Author$
+  ^$ (re)
+  $MySubstKeyword$
+  |VCSMySubstKeyword|
+
+... but simple configuring it in the parent within the "patterns" yields
+... an error
+
+  $ cat >.hgkwarchive <<EOF
+  > [patterns]
+  > subrepo1/** = RCS, reST
+  > src/**.py = RCS, reST
+  > path:VERSION = reST
+  > path:README = RCS, reST
+  > path:test2.txt = RCS, reST
+  > subrepo1/** = RCS, reST
+  > 
+  > [keywords]
+  > JustDate =
+  > HGheader =
+  > HGnodeid =
+  > Date =
+  > Revision =
+  > HGrevision =
+  > Author =
+  > 
+  > MyFullRevision = HGrevision
+  > 
+  > MySubstKeyword = replace:: This is a custom replacement
+  > EOF
+  $ hg commit -m "New kwarchive configuration"
+  $ hg kwarchive -S --path-filter=full --user-filter=full _archive2
+  abort: path 'subrepo1/**' is inside nested repo 'subrepo1'
+  [255]
+
+  $ cd ..
+
+Archiving with nested subrepos
+
+  $ prepare_repo "repo3"
+  $ cd "repo3"
+  $ prepare_subrepo "subrepo1" "subrepos"
+  $ echo `pwd`
+  $TESTTMP/repo3
+  $ cat .hgsubstate
+  ^[a-f0-9]+\s+subrepos/subrepo1$ (re)