~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: ghigo
  • Date: 2007-08-17 17:44:15 UTC
  • mto: (2772.1.1 show-diff)
  • mto: This revision was merged to the branch mainline in revision 2773.
  • Revision ID: ghigo@venice-20070817174415-z9uufl65de5qhvqp
update on the basis of Aaron suggestions

Show diffs side-by-side

added added

removed removed

Lines of Context:
2229
2229
            unchanged=False, strict=False, local=False, fixes=None,
2230
2230
            show_diff=False):
2231
2231
        from bzrlib.commit import (NullCommitReporter, ReportCommitToLog)
2232
 
        from bzrlib.errors import (PointlessCommit, ConflictsInTree,
2233
 
                StrictCommitFailed)
2234
 
        from bzrlib.msgeditor import edit_commit_message_encoded, \
 
2232
        from bzrlib.errors import (
 
2233
                PointlessCommit,
 
2234
                ConflictsInTree,
 
2235
                StrictCommitFailed
 
2236
        )
 
2237
        from bzrlib.msgeditor import (
 
2238
                edit_commit_message_encoded,
2235
2239
                make_commit_message_template_encoded
 
2240
        )
2236
2241
 
2237
2242
        # TODO: Need a blackbox test for invoking the external editor; may be
2238
2243
        # slightly problematic to run this cross-platform.
2260
2265
            """Callback to get commit message"""
2261
2266
            my_message = message
2262
2267
            if my_message is None and not file:
2263
 
                template = make_commit_message_template_encoded(tree, selected_list,
2264
 
                                                        diff=show_diff,
2265
 
                                                        output_encoding=bzrlib.user_encoding)
2266
 
                my_message = edit_commit_message_encoded(template)
 
2268
                t = make_commit_message_template_encoded(tree,
 
2269
                                                         selected_list,
 
2270
                                                         diff=show_diff,
 
2271
                                                         output_encoding=
 
2272
                                                           bzrlib.user_encoding)
 
2273
                my_message = edit_commit_message_encoded(t)
2267
2274
                if my_message is None:
2268
2275
                    raise errors.BzrCommandError("please specify a commit"
2269
2276
                        " message with either --message or --file")
2270
 
            elif (my_message and file ) or \
2271
 
                 (my_message and show_diff ) or \
2272
 
                 (file and show_diff ):
 
2277
            elif ((my_message and file ) or 
 
2278
                  (my_message and show_diff ) or 
 
2279
                  (file and show_diff )):
2273
2280
                raise errors.BzrCommandError(
2274
2281
                    "please specify either --message or --file or --show-diff")
2275
2282
            if file: