Windows 2003上的Mercurial浏览器在显示存储库之前需要进行几次刷新


8

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

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

使用标准的hgwebdir_wspi.py文件(遵循以下副本),通过ISAPI提供信息库。

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

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

hgwebdir_wsgi.py

# 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)

hgweb.config

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

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

您描述的行为很奇怪……我从未见过Mercurial那样表现。我问过Google+上的人是否可以提供帮助。如果我是你,那么我会写信给mercurial@selenic.com,看看那里是否有人可以帮助调试。
马丁·盖斯勒

Answers:


1

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

使用Microsoft的链接,并将站点设置为“立即过期”


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.