view mercurial/remoterepo.py @ 4079:40c9710e8182

Pass a ui from create_server to hgwebdir and a repo from hgwebdir to hgweb This allows repo pages to respect hg serve --webdir-conf <file> --style=gitweb (part of issue253). Since we're creating a ui object anyway, use it as the parentui of the ui objects created for every repo entry. This has the unintended side-effect that --name=foo on the command line will set the name of all repos. If one of the repos being served has a .hg/hgrc owned by a user that is not trusted, hg will now print the "Not trusting file..." warning when reading it. This is consistent with the behaviour from a hg serve from inside the repo.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Tue, 13 Feb 2007 10:01:44 -0200
parents 345bac2bc4ec
children
line wrap: on
line source

# remoterepo - remote repository proxy classes for mercurial
#
# Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.

import repo

class remoterepository(repo.repository):
    def dev(self):
        return -1

    def local(self):
        return False

class remotelock(object):
    def __init__(self, repo):
        self.repo = repo
    def release(self):
        self.repo.unlock()
        self.repo = None
    def __del__(self):
        if self.repo:
            self.release()