~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: John Arbash Meinel
  • Date: 2010-02-10 17:52:08 UTC
  • mfrom: (5021 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5023.
  • Revision ID: john@arbash-meinel.com-20100210175208-bubuwav4uqigu291
Merge bzr.dev 5021 to resolve NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
3441
3441
    def get_transport_type(typestring):
3442
3442
        """Parse and return a transport specifier."""
3443
3443
        if typestring == "sftp":
3444
 
            from bzrlib.transport.sftp import SFTPAbsoluteServer
3445
 
            return SFTPAbsoluteServer
 
3444
            from bzrlib.tests import stub_sftp
 
3445
            return stub_sftp.SFTPAbsoluteServer
3446
3446
        if typestring == "memory":
3447
3447
            from bzrlib.transport.memory import MemoryServer
3448
3448
            return MemoryServer
3777
3777
                    raise errors.BzrCommandError(
3778
3778
                        'Cannot use -r with merge directives or bundles')
3779
3779
                merger, verified = _mod_merge.Merger.from_mergeable(tree,
3780
 
                   mergeable, pb)
 
3780
                   mergeable, None)
3781
3781
 
3782
3782
        if merger is None and uncommitted:
3783
3783
            if revision is not None and len(revision) > 0:
3784
3784
                raise errors.BzrCommandError('Cannot use --uncommitted and'
3785
3785
                    ' --revision at the same time.')
3786
 
            merger = self.get_merger_from_uncommitted(tree, location, pb)
 
3786
            merger = self.get_merger_from_uncommitted(tree, location, None)
3787
3787
            allow_pending = False
3788
3788
 
3789
3789
        if merger is None:
3790
3790
            merger, allow_pending = self._get_merger_from_branch(tree,
3791
 
                location, revision, remember, possible_transports, pb)
 
3791
                location, revision, remember, possible_transports, None)
3792
3792
 
3793
3793
        merger.merge_type = merge_type
3794
3794
        merger.reprocess = reprocess
4065
4065
        # list, we imply that the working tree text has seen and rejected
4066
4066
        # all the changes from the other tree, when in fact those changes
4067
4067
        # have not yet been seen.
4068
 
        pb = ui.ui_factory.nested_progress_bar()
4069
4068
        tree.set_parent_ids(parents[:1])
4070
4069
        try:
4071
 
            merger = _mod_merge.Merger.from_revision_ids(pb,
4072
 
                                                         tree, parents[1])
 
4070
            merger = _mod_merge.Merger.from_revision_ids(None, tree, parents[1])
4073
4071
            merger.interesting_ids = interesting_ids
4074
4072
            merger.merge_type = merge_type
4075
4073
            merger.show_base = show_base
4077
4075
            conflicts = merger.do_merge()
4078
4076
        finally:
4079
4077
            tree.set_parent_ids(parents)
4080
 
            pb.finished()
4081
4078
        if conflicts > 0:
4082
4079
            return 1
4083
4080
        else:
4152
4149
    @staticmethod
4153
4150
    def _revert_tree_to_revision(tree, revision, file_list, no_backup):
4154
4151
        rev_tree = _get_one_revision_tree('revert', revision, tree=tree)
4155
 
        pb = ui.ui_factory.nested_progress_bar()
4156
 
        try:
4157
 
            tree.revert(file_list, rev_tree, not no_backup, pb,
4158
 
                report_changes=True)
4159
 
        finally:
4160
 
            pb.finished()
 
4152
        tree.revert(file_list, rev_tree, not no_backup, None,
 
4153
            report_changes=True)
4161
4154
 
4162
4155
 
4163
4156
class cmd_assert_fail(Command):
4719
4712
                rev_id = b.get_rev_id(revno)
4720
4713
 
4721
4714
        if rev_id is None or _mod_revision.is_null(rev_id):
4722
 
            self.outf.write('No revisions to uncommit.\n')
 
4715
            ui.ui_factory.note('No revisions to uncommit.')
4723
4716
            return 1
4724
4717
 
 
4718
        log_collector = ui.ui_factory.make_output_stream()
4725
4719
        lf = log_formatter('short',
4726
 
                           to_file=self.outf,
 
4720
                           to_file=log_collector,
4727
4721
                           show_timezone='original')
4728
4722
 
4729
4723
        show_log(b,
4734
4728
                 end_revision=last_revno)
4735
4729
 
4736
4730
        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')
 
4731
            ui.ui_factory.note('Dry-run, pretending to remove the above revisions.')
4740
4732
        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
 
4733
            ui.ui_factory.note('The above revision(s) will be removed.')
 
4734
 
 
4735
        if not force:
 
4736
            if not ui.ui_factory.get_boolean('Are you sure [y/N]? '):
 
4737
                ui.ui_factory.note('Canceled')
 
4738
                return 0
4747
4739
 
4748
4740
        mutter('Uncommitting from {%s} to {%s}',
4749
4741
               last_rev_id, rev_id)
4750
4742
        uncommit(b, tree=tree, dry_run=dry_run, verbose=verbose,
4751
4743
                 revno=revno, local=local)
4752
 
        note('You can restore the old tip by running:\n'
4753
 
             '  bzr pull . -r revid:%s', last_rev_id)
 
4744
        ui.ui_factory.note('You can restore the old tip by running:\n'
 
4745
             '  bzr pull . -r revid:%s' % last_rev_id)
4754
4746
 
4755
4747
 
4756
4748
class cmd_break_lock(Command):