[MERGE][Take two] Show the diff in the commit messages
mbp at canonical.com
Tue Jul 17 04:53:42 BST 2007
Martin Pool has voted -1.
Status is now: Vetoed
Thankyou for updating this Goffredo,
def edit_commit_message(infotext, ignoreline=DEFAULT_IGNORE_LINE,
"""Let the user edit a commit message in a temp file.
Putting variables into the default parameters is not a good idea because
the value is saved at the time the function is defined. It's better to
say user_encoding=None, then inside the function
I would probably call those parameters 'output_encoding' or something,
just to be clear that they're not necessarily the same as the global
if user_encoding is None:
user_encoding = bzrlib.user_encoding
+ for l in stream.readlines():
+ if ( l.startswith("===") or l.startswith("---") or
+ l.startswith("+++") ):
+ # the header are utf8 encoded
Parsing out the diff really does not seem like a good idea to me either.
Given John's message, I'm not sure what encoding we should be using for
the diff. But I am pretty sure that it's not the job of the commit code
to rewrite it. It should ask for a diff already encoded to bytes, and
just put that into the commit template. At any rate I would be ok to
bring that in as a first version of this feature.
For details, see:
More information about the bazaar