##// END OF EJS Templates
hgweb: add web.descend configuration variable
Dirkjan Ochtman -
r9363:8635b33e default
parent child Browse files
Show More
@@ -873,6 +873,10 b' Web interface configuration.'
873 873 the list of repositories. The contents of the deny_read list have
874 874 priority over (are examined before) the contents of the allow_read
875 875 list.
876 ``descend``
877 hgwebdir indexes will not descend into subdirectories. Only repositories
878 directly in the current path will be shown (other repositories are still
879 available from the index corresponding to their containing path).
876 880 ``description``
877 881 Textual description of the repository's purpose or contents.
878 882 Default is "unknown".
@@ -198,12 +198,17 b' class hgwebdir(object):'
198 198
199 199 sortdefault = 'name', False
200 200 def entries(sortcolumn="", descending=False, subdir="", **map):
201
201 202 rows = []
202 203 parity = paritygen(self.stripecount)
204 descend = self.ui.configbool('web', 'descend', True)
203 205 for name, path in self.repos:
206
204 207 if not name.startswith(subdir):
205 208 continue
206 209 name = name[len(subdir):]
210 if not descend and '/' in name:
211 continue
207 212
208 213 u = self.ui.copy()
209 214 try:
@@ -29,6 +29,7 b" hg --cwd c ci -Amc -d'3 0'"
29 29 root=`pwd`
30 30 cd ..
31 31
32
32 33 cat > paths.conf <<EOF
33 34 [paths]
34 35 a=$root/a
@@ -50,6 +51,7 b' echo % should succeed'
50 51 echo % should give a 404 - repo is not published
51 52 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw'
52 53
54
53 55 cat > paths.conf <<EOF
54 56 [paths]
55 57 t/a/=$root/a
@@ -83,6 +85,24 b' echo % should succeed, slashy names'
83 85 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/b/d/file/tip/d?style=raw'
84 86
85 87
88 "$TESTDIR/killdaemons.py"
89 cat > paths.conf <<EOF
90 [paths]
91 t/a = $root/a
92 t/b = $root/b
93 c = $root/c
94 [web]
95 descend=false
96 EOF
97
98 hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
99 -A access-paths.log -E error-paths-3.log
100 cat hg.pid >> $DAEMON_PIDS
101 echo % test descend = False
102 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw'
103 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw'
104
105
86 106 cat > collections.conf <<EOF
87 107 [collections]
88 108 $root=$root
@@ -99,9 +119,12 b' echo % collections: should succeed'
99 119 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/file/tip/b?style=raw'
100 120 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/c/file/tip/c?style=raw'
101 121
122
102 123 echo % paths errors 1
103 124 cat error-paths-1.log
104 125 echo % paths errors 2
105 126 cat error-paths-2.log
127 echo % paths errors 3
128 cat error-paths-3.log
106 129 echo % collections errors
107 130 cat error-collections.log
@@ -307,6 +307,18 b' 200 Script output follows'
307 307 200 Script output follows
308 308
309 309 d
310 % test descend = False
311 200 Script output follows
312
313
314 /c/
315
316 200 Script output follows
317
318
319 /t/a/
320 /t/b/
321
310 322 % collections: should succeed
311 323 200 Script output follows
312 324
@@ -327,4 +339,5 b' 200 Script output follows'
327 339 c
328 340 % paths errors 1
329 341 % paths errors 2
342 % paths errors 3
330 343 % collections errors
General Comments 0
You need to be logged in to leave comments. Login now