~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

  • Committer: Vincent Ladeuil
  • Date: 2010-04-22 14:18:17 UTC
  • mto: (5190.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5191.
  • Revision ID: v.ladeuil+lp@free.fr-20100422141817-izoao20264ivkauo
Explain that the uncommitted changes are not processed when
issuing the warning.

* bzrlib/mutabletree.py:
(MutableTree.check_changed_or_out_of_date): Use diferent 'more'
arguments depending on whether we issue a warning or an error.

* bzrlib/send.py:
(send): Add the more_warnings argument when calling
check_changed_or_out_of_date.

* bzrlib/foreign.py:
(cmd_dpush.run): Add the more_warnings argument when calling
check_changed_or_out_of_date.

* bzrlib/builtins.py:
(cmd_push.run): Add the more_warnings argument when calling
check_changed_or_out_of_date.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
73
73
        hidden = True
74
74
    else:
75
75
        hidden = False
76
 
    names = set(_mod_commands.builtin_command_names()) # to eliminate duplicates
77
 
    names.update(_mod_commands.plugin_command_names())
 
76
    names = list(_mod_commands.all_command_names())
78
77
    commands = ((n, _mod_commands.get_cmd_object(n)) for n in names)
79
78
    shown_commands = [(n, o) for n, o in commands if o.hidden == hidden]
80
79
    max_name = max(len(n) for n, o in shown_commands)
81
80
    indent = ' ' * (max_name + 1)
82
 
    width = osutils.terminal_width() - 1
 
81
    width = osutils.terminal_width()
 
82
    if width is None:
 
83
        width = osutils.default_terminal_width
 
84
    # we need one extra space for terminals that wrap on last char
 
85
    width = width - 1
83
86
 
84
87
    for cmd_name, cmd_object in sorted(shown_commands):
85
88
        plugin_name = cmd_object.plugin_name()
94
97
        else:
95
98
            firstline = ''
96
99
        helpstring = '%-*s %s%s' % (max_name, cmd_name, firstline, plugin_name)
97
 
        lines = textwrap.wrap(helpstring, subsequent_indent=indent,
98
 
                              width=width)
 
100
        lines = textwrap.wrap(
 
101
            helpstring, subsequent_indent=indent,
 
102
            width=width,
 
103
            break_long_words=False)
99
104
        for line in lines:
100
105
            out.append(line + '\n')
101
106
    return ''.join(out)