BTS

Message1272

Author mxey
Recipients mxey
Date 2008-03-29.11:46:34
Content
A friend of mine runs hgwebdir as https://host/~user/hg.cgi, which does not work
with hg-mirror. hg-mirror takes for granted that hgwebdir is running from / on
the webserver. This patch fixes the problem.

# HG changeset patch
# User Maximilian Gaß <mxey@cloudconnected.org>
# Date 1206790872 -3600
# Node ID daaa2935ccc19df798594729bdfa87fcd4892442
# Parent  d0689d0310b2cc2ef83393c6b0fddb145b6fe79b
walkrepos: Start from server root, hgweb gives us absolute URLs

diff -r d0689d0310b2 -r daaa2935ccc1 hgutil/hg/util.py
--- a/hgutil/hg/util.py Sat Mar 29 09:37:46 2008 +0100
+++ b/hgutil/hg/util.py Sat Mar 29 12:41:12 2008 +0100
@@ -1,5 +1,6 @@ import os
 import os
 import urllib
+import urlparse
 
 from hgutil.util import QueueListBridge
 
@@ -38,6 +39,11 @@ def walkrepos_flat(path):
 
 def walkrepos_web(url):
     data = urllib.urlopen(url + '/?style=raw')
+
+    # hgweb gives absolute URLs, so start from server root
+    parts = urlparse.urlsplit(url)
+    url = urlparse.urlunsplit((parts[0], parts[1], '', '', ''))
+
     for i in data:
         i = i.strip("/\n")
         if len(i) > 0:
History
Date User Action Args
2008-03-29 11:46:35mxeysetrecipients: + mxey
2008-03-29 11:46:35mxeylinkissue443 messages
2008-03-29 11:46:34mxeycreate