~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/shelf_ui.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
253
253
        :param message: The message to prompt a user with.
254
254
        :return: A character.
255
255
        """
 
256
        if not sys.stdin.isatty():
 
257
            # Since there is no controlling terminal we will hang when trying
 
258
            # to prompt the user, better abort now.  See
 
259
            # https://code.launchpad.net/~bialix/bzr/shelve-no-tty/+merge/14905
 
260
            # for more context.
 
261
            raise errors.BzrError("You need a controlling terminal.")
256
262
        sys.stdout.write(message)
257
263
        char = osutils.getchar()
258
264
        sys.stdout.write("\r" + ' ' * len(message) + '\r')
408
414
            if action == 'dry-run':
409
415
                apply_changes = False
410
416
                delete_shelf = False
411
 
            if action == 'delete-only':
 
417
            elif action == 'delete-only':
412
418
                apply_changes = False
413
419
                read_shelf = False
 
420
            elif action == 'keep':
 
421
                apply_changes = True
 
422
                delete_shelf = False
414
423
        except:
415
424
            tree.unlock()
416
425
            raise