##// END OF EJS Templates
hgweb: add support to explicitly access hidden changesets...
hgweb: add support to explicitly access hidden changesets This changeset adds a "global" `access-hidden` argument to hgweb. This argument lift the "hidden" filtering. This means the request has access to hidden (eg: obsolete) changesets. Secret changesets remains filtered. This feature has multiple applications. The first main use case is to allow the hgweb interface to display more obsolescence related data, such as the Anton Shestakov work to add `obslog` support to hgweb. The second foreseen usecase is support for a `--remote-hidden` argument to `hg pull` and `hg clone`. This flag will make it possible to retrieve hidden (typically obsolete) changeset under some conditions. This is useful when digging up obsolescence history or when doing full mirroring. More on this feature coming in later changesets. To avoid exposing information by mistake, access to this feature is currently controlled with the `experimental.server.allow-hidden-access` config option. The option works the same way as `web.allow-push`. The current default is to not allow any hidden access. However we might change it before the feature stop being experimental.

File last commit:

r50648:ff7134e0 default
r51308:4077d622 default
Show More
notcapable
25 lines | 866 B | text/plain | TextLexer
# Disable the $CAP wire protocol capability.
if test -z "$CAP"
then
echo "CAP environment variable not set."
fi
cat > notcapable-$CAP.py << EOF
from mercurial import extensions, localrepo
from mercurial.interfaces import repository
def extsetup(ui):
extensions.wrapfunction(repository.peer, 'capable', wrapcapable)
extensions.wrapfunction(localrepo.localrepository, 'peer', wrappeer)
def wrapcapable(orig, self, name, *args, **kwargs):
if name in b'$CAP'.split(b' '):
return False
return orig(self, name, *args, **kwargs)
def wrappeer(orig, self, path=None):
# Since we're disabling some newer features, we need to make sure local
# repos add in the legacy features again.
return localrepo.locallegacypeer(self, path=path)
EOF
echo '[extensions]' >> $HGRCPATH
echo "notcapable-$CAP = `pwd`/notcapable-$CAP.py" >> $HGRCPATH