probably bug: bzr log show branch nick as urlencoded string

John Arbash Meinel john at arbash-meinel.com
Thu Oct 19 17:48:26 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko wrote:
> Reproduction:
> 
> $ bzr init !repo
> $ cd !repo
> $ bzr nick
> %21repo
> 
> $ bzr mkdir dir
> $ bzr ci -m initial
> $ bzr log
> ------------------------------------------------------------
> revno: 1
> committer: Alexander Belchenko <bialix at ukr.net>
> branch nick: %21repo
> timestamp: Wed 2006-10-18 14:08:20 +0300
> message:
>   initial
> 
> IIUC, it's because auto-nick is based on URL, and therefore has
> URL-encoded form. So, probably to fix this need to change method that
> obtain auto-nick to decode URL back to normal form.
> 
> -- 
> Alexander

I agree it is a bug. But I don't think it is a bug in 'bzr log', it is a
bug in the auto-nick. We can work around the bugs of earlier entries by
changing the log formatter, but the real fix should be:

=== modified file 'bzrlib/config.py'
- --- bzrlib/config.py    2006-10-16 01:50:48 +0000
+++ bzrlib/config.py    2006-10-19 16:47:25 +0000
@@ -576,7 +576,7 @@
         value = self._get_explicit_nickname()
         if value is not None:
             return value
- -        return self.branch.base.split('/')[-2]
+        return urlutils.unescape(self.branch.base.split('/')[-2])

     def has_explicit_nickname(self):
         """Return true if a nickname has been explicitly assigned."""

I'm kind of surprised to see you use '!repo' as a path, but I guess it
sorts early in directory listings.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFN6xaJdeBCYSNAAMRAsLTAKCa9SSTYLwDd5hVqqZYEFOOlh5TOACeIBG+
lwXnmXSGpLBUPaCL4lL6fZs=
=F/II
-----END PGP SIGNATURE-----





More information about the bazaar mailing list