tests/test-hgwebdir.t
changeset 39487 17ca967e9fca
parent 32004 bd3cb917761a
child 39488 15e8250a82da
equal deleted inserted replaced
39486:1a786fe069b8 39487:17ca967e9fca
    63   > [web]
    63   > [web]
    64   > name = fancy name for repo f
    64   > name = fancy name for repo f
    65   > labels = foo, bar
    65   > labels = foo, bar
    66   > EOF
    66   > EOF
    67   $ cd ..
    67   $ cd ..
       
    68 
       
    69 add file under the directory which could be shadowed by another repository
       
    70 
       
    71   $ mkdir notrepo/f/f3
       
    72   $ echo f3/file > notrepo/f/f3/file
       
    73   $ hg -R notrepo/f ci -Am 'f3/file'
       
    74   adding f3/file
       
    75   $ hg -R notrepo/f update null
       
    76   0 files updated, 0 files merged, 4 files removed, 0 files unresolved
       
    77   $ hg init notrepo/f/f3
       
    78   $ cat <<'EOF' > notrepo/f/f3/.hg/hgrc
       
    79   > [web]
       
    80   > hidden = true
       
    81   > EOF
    68 
    82 
    69 create repository without .hg/store
    83 create repository without .hg/store
    70 
    84 
    71   $ hg init nostore
    85   $ hg init nostore
    72   $ rm -R nostore/.hg/store
    86   $ rm -R nostore/.hg/store
  1215   $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/f/f2/file/tip/f2?style=raw'
  1229   $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/f/f2/file/tip/f2?style=raw'
  1216   200 Script output follows
  1230   200 Script output follows
  1217   
  1231   
  1218   f2
  1232   f2
  1219 
  1233 
       
  1234 Test accessing file that is shadowed by another repository
       
  1235 
       
  1236   $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/f/file/tip/f3/file?style=raw'
       
  1237   403 Forbidden
       
  1238   
       
  1239   
       
  1240   error: path 'f3/file' is inside nested repo 'f3'
       
  1241   [1]
       
  1242 
       
  1243   $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/f/file/ffffffffffff/f3/file?style=raw'
       
  1244   403 Forbidden
       
  1245   
       
  1246   
       
  1247   error: path 'f3/file' is inside nested repo 'f3'
       
  1248   [1]
       
  1249 
       
  1250 Test accessing invalid paths:
       
  1251 
       
  1252   $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/f/file/tip/..?style=raw'
       
  1253   403 Forbidden
       
  1254   
       
  1255   
       
  1256   error: .. not under root '$TESTTMP/dir/webdir/notrepo/f'
       
  1257   [1]
       
  1258 
       
  1259   $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/f/file/tip/.hg/hgrc?style=raw'
       
  1260   403 Forbidden
       
  1261   
       
  1262   
       
  1263   error: path contains illegal component: .hg/hgrc
       
  1264   [1]
       
  1265 
  1220 Test descend = False
  1266 Test descend = False
  1221 
  1267 
  1222   $ killdaemons.py
  1268   $ killdaemons.py
  1223   $ cat >> paths.conf <<EOF
  1269   $ cat >> paths.conf <<EOF
  1224   > descend=false
  1270   > descend=false