[MERGE] Fix for bzr check UI and a minor improvement for the commit message editor
Michael Ellerman
michael at ellerman.id.au
Thu Mar 9 22:33:58 GMT 2006
Hi dudes,
I've just added two more commits to my branch at:
http://michael.ellerman.id.au/files/bzr/mpe
Log and diff below.
cheers
------------------------------------------------------------
revno: 1537
committer: Michael Ellerman <michael at ellerman.id.au>
branch nick: mpe
timestamp: Thu 2006-03-09 11:24:48 +1100
message:
Make the "ignore line" in the commit message editor the "right" width, so
that if you make your message that wide it won't wrap in bzr log output.
Just as a visual aid.
=== modified file 'a/bzrlib/msgeditor.py'
--- a/bzrlib/msgeditor.py
+++ b/bzrlib/msgeditor.py
@@ -67,9 +67,13 @@
break
raise BzrError("Could not start any editor. "
"Please specify $EDITOR or use ~/.bzr.conf/editor")
-
-def edit_commit_message(infotext, ignoreline=None):
+
+DEFAULT_IGNORE_LINE = "%(bar)s %(msg)s %(bar)s" % \
+ { 'bar' : '-' * 14, 'msg' : 'This line and the following will be
ignored' }+
+
+def edit_commit_message(infotext, ignoreline=DEFAULT_IGNORE_LINE):
"""Let the user edit a commit message in a temp file.
This is run if they don't give a message or
@@ -81,10 +85,7 @@
'bzr status'.
"""
import tempfile
-
- if ignoreline is None:
- ignoreline = "-- This line and the following will be ignored --"
-
+
try:
tmp_fileno, msgfilename = tempfile.mkstemp(prefix='bzr_log.',
dir=u'.') msgfile = os.close(tmp_fileno)
------------------------------------------------------------
revno: 1536
committer: Michael Ellerman <michael at ellerman.id.au>
branch nick: mpe
timestamp: Wed 2006-03-08 16:59:36 +1100
message:
Define __str__ for BranchFormat, just return the format string with the
trailing newline stripped. Override __str__ for BranchFormat4 because
it doesn't have a format string. This fixes ugliness in the UI where
people print branch._format, bzr check for one. Fixes bug #33453.
=== modified file 'a/bzrlib/branch.py'
--- a/bzrlib/branch.py
+++ b/bzrlib/branch.py
@@ -603,6 +603,9 @@
assert klass._formats[format.get_format_string()] is format
del klass._formats[format.get_format_string()]
+ def __str__(self):
+ return self.get_format_string().rstrip()
+
class BzrBranchFormat4(BranchFormat):
"""Bzr branch format 4.
@@ -647,6 +650,9 @@
_control_files=a_bzrdir._control_files,
a_bzrdir=a_bzrdir,
_repository=a_bzrdir.open_repository())
+
+ def __str__(self):
+ return "Bazaar-NG branch format 4"
class BzrBranchFormat5(BranchFormat):
More information about the bazaar
mailing list