##// END OF EJS Templates
hgwebdir: don't allow the hidden parent of a subrepo to show as a directory...
Matt Harbison -
r25426:5f3666da stable
parent child Browse files
Show More
@@ -292,6 +292,12 b' class hgwebdir(object):'
292 # remove name parts plus accompanying slash
292 # remove name parts plus accompanying slash
293 path = path[:-len(discarded) - 1]
293 path = path[:-len(discarded) - 1]
294
294
295 try:
296 r = hg.repository(self.ui, path)
297 directory = False
298 except (IOError, error.RepoError):
299 pass
300
295 parts = [name]
301 parts = [name]
296 if 'PATH_INFO' in req.env:
302 if 'PATH_INFO' in req.env:
297 parts.insert(0, req.env['PATH_INFO'].rstrip('/'))
303 parts.insert(0, req.env['PATH_INFO'].rstrip('/'))
@@ -944,6 +944,25 b' Test collapse = True'
944
944
945 Test intermediate directories
945 Test intermediate directories
946
946
947 Hide the subrepo parent
948
949 $ cp $root/notrepo/f/.hg/hgrc $root/notrepo/f/.hg/hgrc.bak
950 $ cat >> $root/notrepo/f/.hg/hgrc << EOF
951 > [web]
952 > hidden = True
953 > EOF
954
955 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'rcoll/notrepo/?style=raw'
956 200 Script output follows
957
958
959 /rcoll/notrepo/e/
960 /rcoll/notrepo/e/e2/
961
962
963 Subrepo parent not hidden
964 $ mv $root/notrepo/f/.hg/hgrc.bak $root/notrepo/f/.hg/hgrc
965
947 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'rcoll/notrepo/?style=raw'
966 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'rcoll/notrepo/?style=raw'
948 200 Script output follows
967 200 Script output follows
949
968
General Comments 0
You need to be logged in to leave comments. Login now