changeset 182:089594a5bbde

Pull from Jake's hg docs
author mpm@selenic.com
date Fri, 27 May 2005 13:09:56 -0800
parents f25944662097 (diff) 038e4d8602bd (current diff)
children 767916673e16
files README doc/README doc/hg.1 doc/hg.1.html doc/hg.1.txt mercurial/hg.py mercurial/hgweb.py
diffstat 3 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/README
+++ b/README
@@ -79,10 +79,14 @@ Network support:
  foo$ hg serve -n "My repo" -p 80
  
  # merge changes from a remote machine
- bar$ hg merge hg://foo/
+ bar$ hg merge http://foo/
  bar$ hg co        # checkout the result
 
  # Set up a CGI server on your webserver
  foo$ cp hgweb.cgi ~/public_html/hg-linux/index.cgi
  foo$ emacs ~/public_html/hg-linux/index.cgi # adjust the defaults
 
+ # Give symbolic names to repos
+ foo$ echo "main http://selenic.com/hg/" >> ~/.hgpaths # one pair per line
+ foo$ hg merge main
+ foo$ hg co
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -812,7 +812,7 @@ class localrepository:
 
 class remoterepository:
     def __init__(self, ui, path):
-        self.url = path.replace("hg://", "http://", 1)
+        self.url = path
         self.ui = ui
 
     def do_cmd(self, cmd, **args):
@@ -847,8 +847,12 @@ class remoterepository:
             yield zd.decompress(d)
 
 def repository(ui, path=None, create=0):
+    if path and path[:7] == "http://":
+        return remoterepository(ui, path)
     if path and path[:5] == "hg://":
-        return remoterepository(ui, path)
+        return remoterepository(ui, path.replace("hg://", "http://"))
+    if path and path[:11] == "old-http://":
+        return localrepository(ui, path.replace("old-http://", "http://"))
     else:
         return localrepository(ui, path, create)
 
--- a/mercurial/hgweb.py
+++ b/mercurial/hgweb.py
@@ -195,7 +195,7 @@ class hgweb:
     def footer(self):
         yield self.t("footer", repo = self.reponame)
 
-    def changelog(self, pos=None):
+    def changelog(self, pos):
         def changenav():
             def seq(factor = 1):
                 yield 1 * factor
@@ -255,7 +255,6 @@ class hgweb:
         cl = self.repo.changelog
         mf = cl.read(cl.tip())[0]
         count = cl.count()
-        pos = pos or count - 1
         end = min(pos, count - 1)
         start = max(0, pos - self.maxchanges)
         end = min(count - 1, start + self.maxchanges)