diff -r 574dc5d74f9b -r d30ec2d16c5a mercurial/util.py --- a/mercurial/util.py Sat Aug 13 00:08:26 2011 +0200 +++ b/mercurial/util.py Sat Sep 10 17:56:42 2011 -0500 @@ -1460,6 +1460,8 @@ >>> url(r'\\blah\blah\blah') + >>> url(r'\\blah\blah\blah#baz') + Authentication credentials: @@ -1488,6 +1490,11 @@ self._hostport = '' self._origpath = path + if parsefragment and '#' in path: + path, self.fragment = path.split('#', 1) + if not path: + path = None + # special case for Windows drive letters and UNC paths if hasdriveletter(path) or path.startswith(r'\\'): self.path = path @@ -1515,10 +1522,6 @@ self.path = '' return else: - if parsefragment and '#' in path: - path, self.fragment = path.split('#', 1) - if not path: - path = None if self._localpath: self.path = path return