comparison cmdutil.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 ffccf0080e54
children 75d4fde9aa2e
comparison
equal deleted inserted replaced
283:521d9c1bb11d 284:f8f9a2993705
282 return True 282 return True
283 283
284 def islocalrepo(url): 284 def islocalrepo(url):
285 if not url.startswith('file:///'): 285 if not url.startswith('file:///'):
286 return False 286 return False
287 if '#' in url.split('/')[-1]: # strip off #anchor
288 url = url[:url.rfind('#')]
287 path = urllib.unquote(url[len('file://'):]) 289 path = urllib.unquote(url[len('file://'):])
288 while '/' in path: 290 while '/' in path:
289 if reduce(lambda x,y: x and y, 291 if reduce(lambda x,y: x and y,
290 map(lambda p: os.path.exists(os.path.join(path, p)), 292 map(lambda p: os.path.exists(os.path.join(path, p)),
291 ('hooks', 'format', 'db', ))): 293 ('hooks', 'format', 'db', ))):