Rev 4810: Fix PQM failures for LC_ALL=C for bug #73073 fix (commit warns for file-name-like messages). in file:///home/vila/src/bzr/reviews/forgot-commit-message/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Tue Dec 8 17:15:15 GMT 2009
At file:///home/vila/src/bzr/reviews/forgot-commit-message/
------------------------------------------------------------
revno: 4810
revision-id: v.ladeuil+lp at free.fr-20091208171515-ga4fpc42c2jtxhju
parent: v.ladeuil+lp at free.fr-20091207103339-ph3ew9c2c0g3er8v
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: forgot-commit-message
timestamp: Tue 2009-12-08 18:15:15 +0100
message:
Fix PQM failures for LC_ALL=C for bug #73073 fix (commit warns for file-name-like messages).
* bzrlib/builtins.py:
(cmd_commit.run): If the filesystem can't use the message as a
file name, the file doesn't exist.
-------------- next part --------------
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2009-12-04 10:24:28 +0000
+++ b/bzrlib/builtins.py 2009-12-08 17:15:15 +0000
@@ -3024,11 +3024,18 @@
raise errors.LocalRequiresBoundBranch()
if message is not None:
- if osutils.lexists(message):
- warning_msg = ("The commit message is a file"
- " name: \"%(filename)s\".\n"
- "(use --file \"%(filename)s\" to take commit message from"
- " that file)" % { 'filename': message })
+ try:
+ file_exists = os.path.exists(message)
+ except UnicodeError:
+ # The commit message contains unicode characters that can't be
+ # represented in the filesystem encoding, so that can't be a
+ # file.
+ file_exists = False
+ if file_exists:
+ warning_msg = (
+ 'The commit message is a file name: "%(f)s".\n'
+ '(use --file "%(f)s" to take commit message from that file)'
+ % { 'f': message })
ui.ui_factory.show_warning(warning_msg)
def get_message(commit_obj):
More information about the bazaar-commits
mailing list