[RFC] Update should mention WHAT it is up to date with
John Arbash Meinel
john at arbash-meinel.com
Thu Dec 10 04:26:56 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John Arbash Meinel wrote:
>
>>> Is there a bzrlib function to take a branch.base URL and shorten it (for
>>> example, file:/// URLs could have the URL prefix removed)? Should we try to
>>> use "." in the shortened form if possible?
>> Generally things like that would be in urlutils. There are functions
>> to turn a url into a local path if possible.
>
>> There was a thread a while ago about a display_url or human_url but I
>> don't think it was implemented. Would be nice. You could always add
>> a stubby implementation ("return url") to start with.
>
>
> urlutils.unescape_for_display(url, output_encoding)
>
> so
>
> out_path = urlutils.unescape_for_display(url, self.outf.encoding)
> self.outf.write('Updating from %s\n' % (out_path,))
^- I should mention that the reason this function takes an encoding, is
because you can have a url that includes escape unicode chars that won't
fit in the output encoding.
This generally only happens on Windows (places where the encodings are
UTF-8). But I can have a branch named جوجو, which as a URL is
file:///C:/dev/%D8%AC%D9%88%D8%AC%D9%88/
If the output was UTF-8, then this would get decoded to
C:/dev/جوجو
However, if the output was latin-1, then it would stay as a file:/// url.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAksgeI8ACgkQJdeBCYSNAANKCQCfRSOgweQClQbHF21n1M0CjgiB
8gEAn3lALDonLvEKbJhtFgDV9rUyACLv
=cbRG
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list