[PATCH] keyword: thorough hgweb testing

Christian Ebert blacktrash at gmx.net
Thu Aug 21 03:32:54 CDT 2008


Hi,

test-keyword ran hgweb after the extension was disabled. This
patch fixes this, and additionally checks hgweb.file and
hgweb.annotate.

c


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1219306844 -7200
# Node ID 876b84f1cec87344be4353b83838becde09ead15
# Parent  2cb708e25a5d87d6fd71ae32ea69c37130f5b690
keyword: thorough hgweb testing

- test hgweb while keyword extension is _enabled_
- check expansion with hgweb.file
- besides log and diff, also check annotate for not expanding

diff --git a/tests/test-keyword b/tests/test-keyword
--- a/tests/test-keyword
+++ b/tests/test-keyword
@@ -285,6 +285,22 @@
 echo % kwexpand nonexistent
 hg kwexpand nonexistent 2>&1 | sed 's/nonexistent:.*/nonexistent:/'
 
+echo % hg serve
+hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
+cat hg.pid >> $DAEMON_PIDS
+echo % expansion
+echo % hgweb file
+("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/a/?style=raw')
+echo % no expansion
+echo % hgweb annotate
+("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/a/?style=raw')
+echo % hgweb changeset
+("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/tip/?style=raw')
+echo % hgweb filediff
+("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/bb948857c743/a?style=raw')
+echo % errors encountered
+cat errors.log
+
 echo % switch off expansion
 echo % kwshrink with unknown file u
 cp a u
@@ -300,13 +316,3 @@
 echo % hg cat
 hg cat sym a b
 echo
-
-echo % hg serve
-hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-echo % hgweb changeset
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/tip/?style=raw')
-echo % hgweb filediff
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/bb948857c743/a?style=raw')
-echo % errors encountered
-cat errors.log
diff --git a/tests/test-keyword.out b/tests/test-keyword.out
--- a/tests/test-keyword.out
+++ b/tests/test-keyword.out
@@ -374,6 +374,63 @@
 $Xinfo$
 % kwexpand nonexistent
 nonexistent:
+% hg serve
+% expansion
+% hgweb file
+200 Script output follows
+
+expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
+do not process $Id:
+xxx $
+$Xinfo: User Name <user at example.com>: firstline $
+% no expansion
+% hgweb annotate
+200 Script output follows
+
+
+User Name <user at example.com>@1: expand $Id$
+User Name <user at example.com>@1: do not process $Id:
+User Name <user at example.com>@1: xxx $
+User Name <user at example.com>@2: $Xinfo$
+
+
+
+
+% hgweb changeset
+200 Script output follows
+
+
+# HG changeset patch
+# User User Name <user at example.com>
+# Date 3 0
+# Node ID cfa68229c1167443337266ebac453c73b1d5d16e
+# Parent bb948857c743469b22bbf51f7ec8112279ca5d83
+xa
+
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ b/x/a	Thu Jan 01 00:00:03 1970 +0000
+@@ -0,0 +1,4 @@
++expand $Id$
++do not process $Id:
++xxx $
++$Xinfo$
+
+% hgweb filediff
+200 Script output follows
+
+
+--- a/a	Thu Jan 01 00:00:00 1970 +0000
++++ b/a	Thu Jan 01 00:00:02 1970 +0000
+@@ -1,3 +1,4 @@
+ expand $Id$
+ do not process $Id:
+ xxx $
++$Xinfo$
+
+
+
+
+% errors encountered
 % switch off expansion
 % kwshrink with unknown file u
 overwriting a shrinking keywords
@@ -404,39 +461,3 @@
 $Xinfo$
 ignore $Id$
 a
-% hg serve
-% hgweb changeset
-200 Script output follows
-
-
-# HG changeset patch
-# User User Name <user at example.com>
-# Date 3 0
-# Node ID cfa68229c1167443337266ebac453c73b1d5d16e
-# Parent bb948857c743469b22bbf51f7ec8112279ca5d83
-xa
-
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/x/a	Thu Jan 01 00:00:03 1970 +0000
-@@ -0,0 +1,4 @@
-+expand $Id$
-+do not process $Id:
-+xxx $
-+$Xinfo$
-
-% hgweb filediff
-200 Script output follows
-
-
---- a/a	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:02 1970 +0000
-@@ -1,3 +1,4 @@
- expand $Id$
- do not process $Id:
- xxx $
-+$Xinfo$
-
-
-
-
-% errors encountered



More information about the Mercurial-devel mailing list