/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Andrew Bennetts
  • Date: 2009-12-18 08:22:42 UTC
  • mfrom: (4906 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4909.
  • Revision ID: andrew.bennetts@canonical.com-20091218082242-f7wy9tlk0yxvkkju
MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1400
1400
            possible_transports=possible_transports)
1401
1401
        if master is not None:
1402
1402
            tree.lock_write()
 
1403
            branch_location = master.base
1403
1404
        else:
1404
1405
            tree.lock_tree_write()
 
1406
            branch_location = tree.branch.base
 
1407
        # get rid of the final '/' and be ready for display
 
1408
        branch_location = urlutils.unescape_for_display(branch_location[:-1],
 
1409
                                                        self.outf.encoding)
1405
1410
        try:
1406
1411
            existing_pending_merges = tree.get_parent_ids()[1:]
1407
1412
            last_rev = _mod_revision.ensure_null(tree.last_revision())
1411
1416
                if master is None or last_rev == _mod_revision.ensure_null(
1412
1417
                    master.last_revision()):
1413
1418
                    revno = tree.branch.revision_id_to_revno(last_rev)
1414
 
                    note("Tree is up to date at revision %d." % (revno,))
 
1419
                    note('Tree is up to date at revision %d of branch %s'
 
1420
                         % (revno, branch_location))
1415
1421
                    return 0
1416
1422
            view_info = _get_view_info_for_change_reporter(tree)
1417
1423
            conflicts = tree.update(
1419
1425
                view_info=view_info), possible_transports=possible_transports)
1420
1426
            revno = tree.branch.revision_id_to_revno(
1421
1427
                _mod_revision.ensure_null(tree.last_revision()))
1422
 
            note('Updated to revision %d.' % (revno,))
 
1428
            note('Updated to revision %d of branch %s' %
 
1429
                 (revno, branch_location))
1423
1430
            if tree.get_parent_ids()[1:] != existing_pending_merges:
1424
1431
                note('Your local commits will now show as pending merges with '
1425
1432
                     "'bzr status', and can be committed with 'bzr commit'.")
2349
2356
            # Build the log formatter
2350
2357
            if log_format is None:
2351
2358
                log_format = log.log_formatter_registry.get_default(b)
 
2359
            # Make a non-encoding output to include the diffs - bug 328007
 
2360
            unencoded_output = ui.ui_factory.make_output_stream(encoding_type='exact')
2352
2361
            lf = log_format(show_ids=show_ids, to_file=self.outf,
 
2362
                            to_exact_file=unencoded_output,
2353
2363
                            show_timezone=timezone,
2354
2364
                            delta_format=get_verbosity_level(),
2355
2365
                            levels=levels,
3066
3076
        if local and not tree.branch.get_bound_location():
3067
3077
            raise errors.LocalRequiresBoundBranch()
3068
3078
 
 
3079
        if message is not None:
 
3080
            try:
 
3081
                file_exists = osutils.lexists(message)
 
3082
            except UnicodeError:
 
3083
                # The commit message contains unicode characters that can't be
 
3084
                # represented in the filesystem encoding, so that can't be a
 
3085
                # file.
 
3086
                file_exists = False
 
3087
            if file_exists:
 
3088
                warning_msg = (
 
3089
                    'The commit message is a file name: "%(f)s".\n'
 
3090
                    '(use --file "%(f)s" to take commit message from that file)'
 
3091
                    % { 'f': message })
 
3092
                ui.ui_factory.show_warning(warning_msg)
 
3093
 
3069
3094
        def get_message(commit_obj):
3070
3095
            """Callback to get commit message"""
3071
3096
            my_message = message
3828
3853
        shelver = shelf_ui.Shelver(merger.this_tree, result_tree, destroy=True,
3829
3854
                                   reporter=shelf_ui.ApplyReporter(),
3830
3855
                                   diff_writer=writer(sys.stdout))
3831
 
        shelver.run()
 
3856
        try:
 
3857
            shelver.run()
 
3858
        finally:
 
3859
            shelver.finalize()
3832
3860
 
3833
3861
    def sanity_check_merger(self, merger):
3834
3862
        if (merger.show_base and
5772
5800
            enum_switch=False, value_switches=True,
5773
5801
            apply="Apply changes and remove from the shelf.",
5774
5802
            dry_run="Show changes, but do not apply or remove them.",
5775
 
            delete_only="Delete changes without applying them."
 
5803
            delete_only="Delete changes without applying them.",
 
5804
            keep="Apply changes but don't delete them.",
5776
5805
        )
5777
5806
    ]
5778
5807
    _see_also = ['shelve']