diff util.py @ 284:f8f9a2993705

Implement parseurl support (#revision in repository urls) Note: Normally when using parseurl, hg clone will treat the revision after # as if it was passed in as --rev, treats that rev as a head and won't clone beyond that. This wasn't implemented here, hence all the TODO's in the comments. All we do is use the checkout parameter where appropriate to update the wc to the selected revision.
author Martijn Pieters <mj@zopatista.com>
date Mon, 27 Apr 2009 09:39:39 -0500
parents 8ff0b3261b7f
children 33736e2e25f0
line wrap: on
line diff
--- a/util.py
+++ b/util.py
@@ -26,7 +26,11 @@ def version(ui):
 def normalize_url(svnurl):
     if svnurl.startswith('svn+http'):
         svnurl = svnurl[4:]
-    return svnurl.rstrip('/')
+    url, revs, checkout = hg.parseurl(svnurl)
+    url = url.rstrip('/')
+    if checkout:
+        url = '%s#%s' % (url, checkout)
+    return url
 
 
 REVMAP_FILE_VERSION = 1