~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/clean_tree.py

  • Committer: Benoît Pierre
  • Date: 2011-10-21 23:05:39 UTC
  • mto: This revision was merged to the branch mainline in revision 6230.
  • Revision ID: benoit.pierre@gmail.com-20111021230539-kimx0vnbbtywqz2z
Fix clean_tree messages and prompt handling.

- use ui.ui_factory.note for output messages, instead of using 'print' directly
- use ui.ui_factory.get_boolean for prompting the user for confirmation

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
            return 0
64
64
        if not no_prompt:
65
65
            for path, subp in deletables:
66
 
                # FIXME using print is very bad idea
67
 
                # clean_tree should accept to_file argument to write the output
68
 
                print subp
69
 
            val = raw_input('Are you sure you wish to delete these [y/N]?')
70
 
            if val.lower() not in ('y', 'yes'):
71
 
                print 'Canceled'
 
66
                ui.ui_factory.note(subp)
 
67
            prompt = 'Are you sure you wish to delete these'
 
68
            if not ui.ui_factory.get_boolean(prompt):
 
69
                ui.ui_factory.note('Canceled')
72
70
                return 0
73
71
        delete_items(deletables, dry_run=dry_run)
74
72
    finally: