[MERGE][Take Five] Show the diff in the commit messages

Goffredo Baroncelli kreijack at tiscalinet.it
Thu Jul 26 07:06:24 BST 2007


On Thursday 26 July 2007, you (Aaron Bentley) wrote:
> Goffredo Baroncelli wrote:
> > On Monday 23 July 2007, you (Aaron Bentley) wrote:
> >> If you pass an encoding into make_commit_message_template, you can turn
> >> the status output into the correct encoding.  You can also pass the
> >> encoding into show_diff trees, so that it can emit the paths in the
> >> desired encoding.
> >
> > Hi All,
> >
> > === modified file 'bzrlib/diff.py'
> > --- bzrlib/diff.py	2007-04-11 22:05:16 +0000
> > +++ bzrlib/diff.py	2007-07-25 21:25:08 +0000
> > @@ -378,7 +378,8 @@
> >  def show_diff_trees(old_tree, new_tree, to_file, specific_files=None,
> >                      external_diff_options=None,
> >                      old_label='a/', new_label='b/',
> > -                    extra_trees=None):
> > +                    extra_trees=None,
> > +                    path_encoding=None):
[...]
> > +    if path_encoding is None:
> > +        path_encoding = 'utf8'
> 
> ^^^ It would make sense to make the parameter default to 'utf-8' instead
> of None.  This is safe because strings are immutable.
Done

[...]
> > +        print >>to_file, '=== removed %s %r' % (kind,
> > +                                                
path.encode(path_encoding))
> ^^^ I think these should all be path.encode(path_encoding, 'replace').
> We don't want commit to die if the path isn't valid in the user's encoding.
Done

> 
> Aaron
Goffredo



-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack at inwind.it>
Key fingerprint = CE3C 7E01 6782 30A3 5B87  87C0 BB86 505C 6B2A CFF9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzr-ci---show-diff.bundle.diff
Type: text/x-diff
Size: 27218 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070726/6efcd914/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070726/6efcd914/attachment-0001.pgp 


More information about the bazaar mailing list