~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/shelf_ui.py

  • Committer: Daniel Watkins
  • Date: 2009-02-10 00:43:48 UTC
  • mto: (4010.1.1 bzr.dev)
  • mto: This revision was merged to the branch mainline in revision 4015.
  • Revision ID: daniel@daniel-watkins.co.uk-20090210004348-l5pkl1g9rj9wddpy
Added help option to shelve prompt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
        sys.stdout.flush()
158
158
        return char
159
159
 
160
 
    def prompt_bool(self, question):
 
160
    def prompt_bool(self, question, long=False):
161
161
        """Prompt the user with a yes/no question.
162
162
 
163
163
        This may be overridden by self.auto.  It may also *set* self.auto.  It
167
167
        """
168
168
        if self.auto:
169
169
            return True
170
 
        char = self.prompt(question + ' [yNfq]')
 
170
        if long:
 
171
            prompt = ' [(y)es, (N)o, (f)inish, or (q)uit]'
 
172
        else:
 
173
            prompt = ' [yNfq?]'
 
174
        char = self.prompt(question + prompt)
171
175
        if char == 'y':
172
176
            return True
173
177
        elif char == 'f':
174
178
            self.auto = True
175
179
            return True
 
180
        elif char == '?':
 
181
            return self.prompt_bool(question, long=True)
176
182
        if char == 'q':
177
183
            raise errors.UserAbort()
178
184
        else: