"Using Saved Location: foo"
Jan Hudec
bulb at ucw.cz
Fri Apr 28 08:15:26 BST 2006
On Fri, Apr 28, 2006 at 17:02:40 +1000, Martin Pool wrote:
> On 28/04/2006, at 12:55 AM, John Arbash Meinel wrote:
>
> >Aaron Bentley wrote:
> >>John Arbash Meinel wrote:
> >>>But for local file URLs, it seems like it would be nicer to
> >>>display the
> >>>actual Unicode path.
> >>
> >>Makes sense to me.
>
> I think we want a method that gives the "best display form" for a URL
> in the current user encoding.
>
> For we will *try* to decode them as utf-8 and then put them into the
> user encoding. If that's not possible, we just use the regular URL
> form. In more detail: scan for escape sequences, and work out what
> byte they represent. If it's a byte that has special meaning in URLs
> [/?,;#&%+ ] then leave it alone, otherwise unescape it. Now try to
> decode as UTF-8, and then check that the result is representable in
> the user encoding - if either of those fail, leave it as an escaped
> URL. Obviously this needs to be symmetric with the algorithm for
> turning url-like unicode strings into real URLs, and I think it is.
Space should not be in that list -- if we get raw space in url-like
string, we encode it (while we mustn't do it with the other, truly
special ones) so we should decode it as well IMHO.
> [...]
> John, Robert and I talked about this on irc.
>
> A related issue is that if you do a pull while cwd is in a
> subdirectory of a branch, the relative path stored should not be the
> one you typed, but rather the relative path from the root of your
> branch.
>
> There may be some slightly tricky cases caused by symlinks.
>
> Branch APIs that deal with locations (e.g. Branch.base) should return
> urls, even for local branches.
>
> The parent is also a URL or relative reference. That means that it
> can be e.g. "../bzr.dev", but it is escaped as a URL. Setting the
> parent will work like this:
Can I suggest having a:
class url(string):
...
?
Then various places in the code can assert that they really have and
url (I'd include relative-url-reference) in it.
> - get the base url of the new parent
> - find the relative path from the current branch's url to that url,
> if possible. If the urls are in different schemes or hosts, or are
> different from the first component of the path, then store the
> absolute url.
--
Jan 'Bulb' Hudec <bulb at ucw.cz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060428/91677a80/attachment.pgp
More information about the bazaar
mailing list