Rev 4878: Fix PQM failures in http://bazaar.launchpad.net/~vila/bzr/integration2

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Dec 8 17:30:26 GMT 2009


At http://bazaar.launchpad.net/~vila/bzr/integration2

------------------------------------------------------------
revno: 4878 [merge]
revision-id: v.ladeuil+lp at free.fr-20091208173011-dlkto90jn1ieqbyh
parent: pqm at pqm.ubuntu.com-20091208115427-mzef85j2qbc0nyu9
parent: v.ladeuil+lp at free.fr-20091208171515-ga4fpc42c2jtxhju
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: integration2
timestamp: Tue 2009-12-08 18:30:11 +0100
message:
  Fix PQM failures
modified:
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
-------------- next part --------------
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2009-12-07 21:46:28 +0000
+++ b/bzrlib/builtins.py	2009-12-08 17:30:11 +0000
@@ -3067,11 +3067,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