Show More
@@ -873,6 +873,10 b' Web interface configuration.' | |||||
873 | the list of repositories. The contents of the deny_read list have |
|
873 | the list of repositories. The contents of the deny_read list have | |
874 | priority over (are examined before) the contents of the allow_read |
|
874 | priority over (are examined before) the contents of the allow_read | |
875 | list. |
|
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 | ``description`` |
|
880 | ``description`` | |
877 | Textual description of the repository's purpose or contents. |
|
881 | Textual description of the repository's purpose or contents. | |
878 | Default is "unknown". |
|
882 | Default is "unknown". |
@@ -198,12 +198,17 b' class hgwebdir(object):' | |||||
198 |
|
198 | |||
199 | sortdefault = 'name', False |
|
199 | sortdefault = 'name', False | |
200 | def entries(sortcolumn="", descending=False, subdir="", **map): |
|
200 | def entries(sortcolumn="", descending=False, subdir="", **map): | |
|
201 | ||||
201 | rows = [] |
|
202 | rows = [] | |
202 | parity = paritygen(self.stripecount) |
|
203 | parity = paritygen(self.stripecount) | |
|
204 | descend = self.ui.configbool('web', 'descend', True) | |||
203 | for name, path in self.repos: |
|
205 | for name, path in self.repos: | |
|
206 | ||||
204 | if not name.startswith(subdir): |
|
207 | if not name.startswith(subdir): | |
205 | continue |
|
208 | continue | |
206 | name = name[len(subdir):] |
|
209 | name = name[len(subdir):] | |
|
210 | if not descend and '/' in name: | |||
|
211 | continue | |||
207 |
|
212 | |||
208 | u = self.ui.copy() |
|
213 | u = self.ui.copy() | |
209 | try: |
|
214 | try: |
@@ -29,6 +29,7 b" hg --cwd c ci -Amc -d'3 0'" | |||||
29 | root=`pwd` |
|
29 | root=`pwd` | |
30 | cd .. |
|
30 | cd .. | |
31 |
|
31 | |||
|
32 | ||||
32 | cat > paths.conf <<EOF |
|
33 | cat > paths.conf <<EOF | |
33 | [paths] |
|
34 | [paths] | |
34 | a=$root/a |
|
35 | a=$root/a | |
@@ -50,6 +51,7 b' echo % should succeed' | |||||
50 | echo % should give a 404 - repo is not published |
|
51 | echo % should give a 404 - repo is not published | |
51 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw' |
|
52 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw' | |
52 |
|
53 | |||
|
54 | ||||
53 | cat > paths.conf <<EOF |
|
55 | cat > paths.conf <<EOF | |
54 | [paths] |
|
56 | [paths] | |
55 | t/a/=$root/a |
|
57 | t/a/=$root/a | |
@@ -83,6 +85,24 b' echo % should succeed, slashy names' | |||||
83 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/b/d/file/tip/d?style=raw' |
|
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 | cat > collections.conf <<EOF |
|
106 | cat > collections.conf <<EOF | |
87 | [collections] |
|
107 | [collections] | |
88 | $root=$root |
|
108 | $root=$root | |
@@ -99,9 +119,12 b' echo % collections: should succeed' | |||||
99 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/file/tip/b?style=raw' |
|
119 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/file/tip/b?style=raw' | |
100 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/c/file/tip/c?style=raw' |
|
120 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/c/file/tip/c?style=raw' | |
101 |
|
121 | |||
|
122 | ||||
102 | echo % paths errors 1 |
|
123 | echo % paths errors 1 | |
103 | cat error-paths-1.log |
|
124 | cat error-paths-1.log | |
104 | echo % paths errors 2 |
|
125 | echo % paths errors 2 | |
105 | cat error-paths-2.log |
|
126 | cat error-paths-2.log | |
|
127 | echo % paths errors 3 | |||
|
128 | cat error-paths-3.log | |||
106 | echo % collections errors |
|
129 | echo % collections errors | |
107 | cat error-collections.log |
|
130 | cat error-collections.log |
@@ -307,6 +307,18 b' 200 Script output follows' | |||||
307 | 200 Script output follows |
|
307 | 200 Script output follows | |
308 |
|
308 | |||
309 | d |
|
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 | % collections: should succeed |
|
322 | % collections: should succeed | |
311 | 200 Script output follows |
|
323 | 200 Script output follows | |
312 |
|
324 | |||
@@ -327,4 +339,5 b' 200 Script output follows' | |||||
327 | c |
|
339 | c | |
328 | % paths errors 1 |
|
340 | % paths errors 1 | |
329 | % paths errors 2 |
|
341 | % paths errors 2 | |
|
342 | % paths errors 3 | |||
330 | % collections errors |
|
343 | % collections errors |
General Comments 0
You need to be logged in to leave comments.
Login now