[PATCH 4 of 9] keyword: add test for keyword expansion at serving multiple repositories

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Sun Jun 25 15:09:37 EDT 2017


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1498416057 -32400
#      Mon Jun 26 03:40:57 2017 +0900
# Node ID 133d12414af420ccfb9c2353877c1efc1903d00e
# Parent  9422af09fb1ad4ccbd0132c4796eef2fcb83e002
keyword: add test for keyword expansion at serving multiple repositories

This is safety for subsequent (and future) patches, which change
function wrapping.

diff --git a/tests/test-keyword.t b/tests/test-keyword.t
--- a/tests/test-keyword.t
+++ b/tests/test-keyword.t
@@ -1097,6 +1097,7 @@ at subsequent webcommands)
   xxx $
   $Xinfo: User Name <user at example.com>: firstline $
 
+  $ killdaemons.py
   $ cat errors.log
 #endif
 
@@ -1429,3 +1430,46 @@ suppress expanding keywords at subsequen
   bar
 
   $ cd ..
+
+#if serve
+
+Test that keywords are expanded only in repositories, which enable
+keyword extension, even if multiple repositories are served in a
+process
+
+  $ cat >> fetch-merge/.hg/hgrc <<EOF
+  > [extensions]
+  > keyword = !
+  > EOF
+
+  $ cat > paths.conf <<EOF
+  > [paths]
+  > enabled=Test
+  > disabled=fetch-merge
+  > EOF
+
+  $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log --webdir-conf paths.conf
+  $ cat hg.pid >> $DAEMON_PIDS
+
+  $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw'
+  200 Script output follows
+  
+  $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
+  bar
+
+  $ get-with-headers.py localhost:$HGPORT 'disabled/file/tip/m/?style=raw'
+  200 Script output follows
+  
+  $Id$
+  bar
+
+(check expansion again, for safety)
+
+  $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw'
+  200 Script output follows
+  
+  $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
+  bar
+
+  $ killdaemons.py
+#endif


More information about the Mercurial-devel mailing list