~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-06 10:54:35 UTC
  • mfrom: (5010.1.3 ui-factory)
  • Revision ID: pqm@pqm.ubuntu.com-20100206105435-3mmfhv9xg6267nyy
(mbp) change cmd_uncommit to use UIFactory more

Show diffs side-by-side

added added

removed removed

Lines of Context:
4719
4719
                rev_id = b.get_rev_id(revno)
4720
4720
 
4721
4721
        if rev_id is None or _mod_revision.is_null(rev_id):
4722
 
            self.outf.write('No revisions to uncommit.\n')
 
4722
            ui.ui_factory.note('No revisions to uncommit.')
4723
4723
            return 1
4724
4724
 
 
4725
        log_collector = ui.ui_factory.make_output_stream()
4725
4726
        lf = log_formatter('short',
4726
 
                           to_file=self.outf,
 
4727
                           to_file=log_collector,
4727
4728
                           show_timezone='original')
4728
4729
 
4729
4730
        show_log(b,
4734
4735
                 end_revision=last_revno)
4735
4736
 
4736
4737
        if dry_run:
4737
 
            print 'Dry-run, pretending to remove the above revisions.'
4738
 
            if not force:
4739
 
                val = raw_input('Press <enter> to continue')
 
4738
            ui.ui_factory.note('Dry-run, pretending to remove the above revisions.')
4740
4739
        else:
4741
 
            print 'The above revision(s) will be removed.'
4742
 
            if not force:
4743
 
                val = raw_input('Are you sure [y/N]? ')
4744
 
                if val.lower() not in ('y', 'yes'):
4745
 
                    print 'Canceled'
4746
 
                    return 0
 
4740
            ui.ui_factory.note('The above revision(s) will be removed.')
 
4741
 
 
4742
        if not force:
 
4743
            if not ui.ui_factory.get_boolean('Are you sure [y/N]? '):
 
4744
                ui.ui_factory.note('Canceled')
 
4745
                return 0
4747
4746
 
4748
4747
        mutter('Uncommitting from {%s} to {%s}',
4749
4748
               last_rev_id, rev_id)
4750
4749
        uncommit(b, tree=tree, dry_run=dry_run, verbose=verbose,
4751
4750
                 revno=revno, local=local)
4752
 
        note('You can restore the old tip by running:\n'
4753
 
             '  bzr pull . -r revid:%s', last_rev_id)
 
4751
        ui.ui_factory.note('You can restore the old tip by running:\n'
 
4752
             '  bzr pull . -r revid:%s' % last_rev_id)
4754
4753
 
4755
4754
 
4756
4755
class cmd_break_lock(Command):