tests/test-subrepo-svn.t
changeset 21585 652e07debf10
parent 21503 10f15e34d86c
parent 21567 5900bc09e684
child 21930 a5168eb9b2bc
--- a/tests/test-subrepo-svn.t	Sat Mar 08 19:02:39 2014 +1100
+++ b/tests/test-subrepo-svn.t	Tue May 27 17:41:20 2014 -0700
@@ -635,3 +635,54 @@
   Checked out revision 15.
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd ..
+
+Test sanitizing ".hg/hgrc" in subrepo
+
+  $ cd sub/t
+  $ hg update -q -C tip
+  $ cd s
+  $ mkdir .hg
+  $ echo '.hg/hgrc in svn repo' > .hg/hgrc
+  $ mkdir -p sub/.hg
+  $ echo 'sub/.hg/hgrc in svn repo' > sub/.hg/hgrc
+  $ svn add .hg sub
+  A         .hg
+  A         .hg/hgrc (glob)
+  A         sub
+  A         sub/.hg (glob)
+  A         sub/.hg/hgrc (glob)
+  $ svn ci -m 'add .hg/hgrc to be sanitized at hg update'
+  Adding         .hg
+  Adding         .hg/hgrc (glob)
+  Adding         sub
+  Adding         sub/.hg (glob)
+  Adding         sub/.hg/hgrc (glob)
+  Transmitting file data ..
+  Committed revision 16.
+  $ svn up -q
+  $ cd ..
+  $ hg commit -S -m 'commit with svn revision including .hg/hgrc'
+  $ grep ' s$' .hgsubstate
+  16 s
+  $ cd ..
+
+  $ hg -R tc pull -u -q 2>&1 | sort
+  warning: removing potentially hostile 'hgrc' in '$TESTTMP/sub/tc/s/.hg' (glob)
+  warning: removing potentially hostile 'hgrc' in '$TESTTMP/sub/tc/s/sub/.hg' (glob)
+  $ cd tc
+  $ grep ' s$' .hgsubstate
+  16 s
+  $ cat s/.hg/hgrc
+  cat: s/.hg/hgrc: No such file or directory
+  [1]
+  $ cat s/sub/.hg/hgrc
+  cat: s/sub/.hg/hgrc: No such file or directory
+  [1]
+
+Test that sanitizing is omitted in meta data area:
+
+  $ mkdir s/.svn/.hg
+  $ echo '.hg/hgrc in svn metadata area' > s/.svn/.hg/hgrc
+  $ hg update -q -C '.^1'
+
+  $ cd ../..