Branch nick on commit log

John Arbash Meinel john at arbash-meinel.com
Thu Feb 1 16:58:38 GMT 2007


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

Gustavo Niemeyer wrote:
> Hey folks,
> 
> I've got a small suggestion: it would be nice to have the
> current branch nick at the top of the comments shown when
> presenting the editor for entering the log message.
> 
> Something as simple as:
> 
>   --------- This line and the following will be ignored ---------
> 
>   branch: <nick>
> 
>   modified:
>     ...
> 

I'm curious what you want to do with this, but a patch as simple as this
should do it:

=== modified file 'bzrlib/msgeditor.py'
- --- bzrlib/msgeditor.py 2006-11-11 19:25:25 +0000
+++ bzrlib/msgeditor.py 2007-02-01 16:57:57 +0000
@@ -163,6 +163,7 @@
     from StringIO import StringIO       # must be unicode-safe
     from bzrlib.status import show_tree_status
     status_tmp = StringIO()
+    status_tmp.write('branch: %s\n' % (working_tree.branch.nick,))
     show_tree_status(working_tree, specific_files=specific_files,
                      to_file=status_tmp)
     return status_tmp.getvalue()

(naturally, we would want to add test cases, etc, but this should do the
basic work)

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFwhw9JdeBCYSNAAMRArASAKCyWBdPeQgIx+OceAfO8F4YURYBggCeJJLy
KpJ791l40VmUXU9AmG7AM3c=
=Betn
-----END PGP SIGNATURE-----



More information about the bazaar mailing list