~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Martin Pool
  • Date: 2007-08-31 05:32:00 UTC
  • mfrom: (2598.6.32 bzr-ci-verbose2)
  • mto: This revision was merged to the branch mainline in revision 2773.
  • Revision ID: mbp@sourcefrog.net-20070831053200-px49z9ajuv15dxpi
Merge commit --show-diff feature from Goffredo

Show diffs side-by-side

added added

removed removed

Lines of Context:
2194
2194
                         "the master branch until a normal commit "
2195
2195
                         "is performed."
2196
2196
                    ),
 
2197
              Option('show-diff',
 
2198
                     help='When no message is supplied, show the diff along'
 
2199
                     ' with the status summary in the message editor.'),
2197
2200
             ]
2198
2201
    aliases = ['ci', 'checkin']
2199
2202
 
2221
2224
 
2222
2225
    def run(self, message=None, file=None, verbose=True, selected_list=None,
2223
2226
            unchanged=False, strict=False, local=False, fixes=None,
2224
 
            author=None):
2225
 
        from bzrlib.commit import (NullCommitReporter, ReportCommitToLog)
2226
 
        from bzrlib.errors import (PointlessCommit, ConflictsInTree,
2227
 
                StrictCommitFailed)
2228
 
        from bzrlib.msgeditor import edit_commit_message, \
2229
 
                make_commit_message_template
 
2227
            author=None, show_diff=False):
 
2228
        from bzrlib.commit import (
 
2229
            NullCommitReporter,
 
2230
            ReportCommitToLog
 
2231
        )
 
2232
        from bzrlib.errors import (
 
2233
            PointlessCommit,
 
2234
            ConflictsInTree,
 
2235
            StrictCommitFailed
 
2236
        )
 
2237
        from bzrlib.msgeditor import (
 
2238
            edit_commit_message_encoded,
 
2239
            make_commit_message_template_encoded
 
2240
        )
2230
2241
 
2231
2242
        # TODO: Need a blackbox test for invoking the external editor; may be
2232
2243
        # slightly problematic to run this cross-platform.
2254
2265
            """Callback to get commit message"""
2255
2266
            my_message = message
2256
2267
            if my_message is None and not file:
2257
 
                template = make_commit_message_template(tree, selected_list)
2258
 
                my_message = edit_commit_message(template)
 
2268
                t = make_commit_message_template_encoded(tree,
 
2269
                        selected_list, diff=show_diff,
 
2270
                        output_encoding=bzrlib.user_encoding)
 
2271
                my_message = edit_commit_message_encoded(t)
2259
2272
                if my_message is None:
2260
2273
                    raise errors.BzrCommandError("please specify a commit"
2261
2274
                        " message with either --message or --file")