Windows 2003 上的 Mercurial 浏览器需要刷新几次才能显示存储库

Windows 2003 上的 Mercurial 浏览器需要刷新几次才能显示存储库

当我尝试浏览我的 Mercurial 存储库时,通常需要刷新几次才能显示存储库列表。配置如下:

  • Windows Server 2003(专用计算机由http://www.server4you.com/
  • 网站具有自签名 SSL 的匿名密码保护。
  • Mercurial 1.5.3
  • Python 2.6.5
  • 适用于 Windows 的 Python 32 扩展 214 py2.6
  • isapi-wsgi 0.4.2

该存储库通过 ISAPI 使用标准 hgwebdir_wspi.py 文件(复制到后面)提供服务。

另外,在执行克隆/推送/等操作之前,我必须先浏览存储库,否则我本地机器上的 hg 无法找到该站点。

我该怎么做才能开始追踪这个问题?

复制代码

# Configuration file location
hgweb_config = r'C:\Public\Mercurial\WebSite\hgweb.config'

# Global settings for IIS path translation
path_strip = 0   # Strip this many path elements off (when using url rewrite)
path_prefix = 0  # This many path elements are prefixes (depends on the
                 # virtual path of the IIS application).

import sys

# Adjust python path if this is not a system-wide install
#sys.path.insert(0, r'c:\path\to\python\lib')

# Enable tracing. Run 'python -m win32traceutil' to debug
if hasattr(sys, 'isapidllhandle'):
    import win32traceutil

# To serve pages in local charset instead of UTF-8, remove the two lines below
import os
os.environ['HGENCODING'] = 'UTF-8'


import isapi_wsgi
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb.hgwebdir_mod import hgwebdir

# Example tweak: Replace isapi_wsgi's handler to provide better error message
# Other stuff could also be done here, like logging errors etc.
class WsgiHandler(isapi_wsgi.IsapiWsgiHandler):
    error_status = '500 Internal Server Error' # less silly error message

isapi_wsgi.IsapiWsgiHandler = WsgiHandler

# Only create the hgwebdir instance once
application = hgwebdir(hgweb_config)

def handler(environ, start_response):

    # Translate IIS's weird URLs
    url = environ['SCRIPT_NAME'] + environ['PATH_INFO']
    paths = url[1:].split('/')[path_strip:]
    script_name = '/' + '/'.join(paths[:path_prefix])
    path_info = '/'.join(paths[path_prefix:])
    if path_info:
        path_info = '/' + path_info
    environ['SCRIPT_NAME'] = script_name
    environ['PATH_INFO'] = path_info

    return application(environ, start_response)

def __ExtensionFactory__():
    return isapi_wsgi.ISAPISimpleHandler(handler)

if __name__=='__main__':
    from isapi.install import *
    params = ISAPIParameters()
    HandleCommandLine(params)

网页配置工具

[paths]
/ = C:\Public\Mercurial\Repositories\*

[web]
allow_archive = bz2 gz zip      ; Allows archive downloads.
allow_push = ########       ; Users that are allowed to push.

答案1

听起来 IIS 6 正在缓存您的网页(您没有定义是否使用 Apache,因此我假设它是 Windows 服务器)

用这个来自微软的链接并将网站设置为立即过期

答案2

途中缓存了一些东西。使用 curl 或 wget 获取页面并检查 http 标头。没有 ssl 会更好吗?

相关内容