# HG changeset patch # User Matt Mackall # Date 1272597254 18000 # Node ID bf7e63fedca12ab725af8a5cb0d0eced403bc7ec # Parent 5d35f7d93514566fbc53d93dbcdae71495ba61df# Parent e4f911ce21de5f8cee669da95774d4d8af261e96 Merge with stable diff -r 5d35f7d93514 -r bf7e63fedca1 mercurial/help/templates.txt --- a/mercurial/help/templates.txt Wed Apr 07 00:45:20 2010 +0900 +++ b/mercurial/help/templates.txt Thu Apr 29 22:14:14 2010 -0500 @@ -6,8 +6,9 @@ You can customize output for any "log-like" command: log, outgoing, incoming, tip, parents, heads and glog. -Three styles are packaged with Mercurial: default (the style used -when no explicit preference is passed), compact and changelog. +Four styles are packaged with Mercurial: default (the style used +when no explicit preference is passed), compact, changelog, +and xml. Usage:: $ hg log -r1 --style changelog diff -r 5d35f7d93514 -r bf7e63fedca1 mercurial/url.py --- a/mercurial/url.py Wed Apr 07 00:45:20 2010 +0900 +++ b/mercurial/url.py Thu Apr 29 22:14:14 2010 -0500 @@ -11,17 +11,28 @@ from i18n import _ import keepalive, util +def _urlunparse(scheme, netloc, path, params, query, fragment, url): + '''Handle cases where urlunparse(urlparse(x://)) doesn't preserve the "//"''' + result = urlparse.urlunparse((scheme, netloc, path, params, query, fragment)) + if (scheme and + result.startswith(scheme + ':') and + not result.startswith(scheme + '://') and + url.startswith(scheme + '://') + ): + result = scheme + '://' + result[len(scheme + ':'):] + return result + def hidepassword(url): '''hide user credential in a url string''' scheme, netloc, path, params, query, fragment = urlparse.urlparse(url) netloc = re.sub('([^:]*):([^@]*)@(.*)', r'\1:***@\3', netloc) - return urlparse.urlunparse((scheme, netloc, path, params, query, fragment)) + return _urlunparse(scheme, netloc, path, params, query, fragment, url) def removeauth(url): '''remove all authentication information from a url string''' scheme, netloc, path, params, query, fragment = urlparse.urlparse(url) netloc = netloc[netloc.find('@')+1:] - return urlparse.urlunparse((scheme, netloc, path, params, query, fragment)) + return _urlunparse(scheme, netloc, path, params, query, fragment, url) def netlocsplit(netloc): '''split [user[:passwd]@]host[:port] into 4-tuple.'''