/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Martin Pool
  • Date: 2010-06-11 07:32:12 UTC
  • mto: This revision was merged to the branch mainline in revision 5309.
  • Revision ID: mbp@canonical.com-20100611073212-w3cz2yachitiiz2c
Update remaining subclasses of ExternalBase

Show diffs side-by-side

added added

removed removed

Lines of Context:
491
491
    takes_options = [
492
492
        Option('force',
493
493
               help='Remove the working tree even if it has '
494
 
                    'uncommitted changes.'),
 
494
                    'uncommitted or shelved changes.'),
495
495
        ]
496
496
 
497
497
    def run(self, location_list, force=False):
511
511
            if not force:
512
512
                if (working.has_changes()):
513
513
                    raise errors.UncommittedChanges(working)
 
514
                if working.get_shelf_manager().last_shelf() is not None:
 
515
                    raise errors.ShelvedChanges(working)
514
516
 
515
517
            if working.user_url != working.branch.user_url:
516
518
                raise errors.BzrCommandError("You cannot remove the working tree"
1336
1338
            except errors.NoWorkingTree:
1337
1339
                source.bzrdir.create_workingtree(revision_id)
1338
1340
                return
1339
 
 
1340
 
        if not lightweight:
1341
 
            message = ('Copying history to "%s". '
1342
 
                'To checkout without local history use --lightweight.' % to_location)
1343
 
            ui.ui_factory.show_message(message)
1344
1341
        source.create_checkout(to_location, revision_id, lightweight,
1345
1342
                               accelerator_tree, hardlink)
1346
1343
 
3150
3147
        def get_message(commit_obj):
3151
3148
            """Callback to get commit message"""
3152
3149
            if file:
3153
 
                my_message = codecs.open(
3154
 
                    file, 'rt', osutils.get_user_encoding()).read()
 
3150
                f = codecs.open(file, 'rt', osutils.get_user_encoding())
 
3151
                try:
 
3152
                    my_message = f.read()
 
3153
                finally:
 
3154
                    f.close()
3155
3155
            elif message is not None:
3156
3156
                my_message = message
3157
3157
            else:
3594
3594
            self.additional_selftest_args['runner_class'] = SubUnitBzrRunner
3595
3595
            # On Windows, disable automatic conversion of '\n' to '\r\n' in
3596
3596
            # stdout, which would corrupt the subunit stream. 
3597
 
            if sys.platform == "win32" and sys.stdout.fileno() >= 0:
 
3597
            # FIXME: This has been fixed in subunit trunk (>0.0.5) so the
 
3598
            # following code can be deleted when it's sufficiently deployed
 
3599
            # -- vila/mgz 20100514
 
3600
            if (sys.platform == "win32"
 
3601
                and getattr(sys.stdout, 'fileno', None) is not None):
3598
3602
                import msvcrt
3599
3603
                msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
3600
3604
        if parallel:
5126
5130
    given, in which case it is sent to a file.
5127
5131
 
5128
5132
    Mail is sent using your preferred mail program.  This should be transparent
5129
 
    on Windows (it uses MAPI).  On Linux, it requires the xdg-email utility.
 
5133
    on Windows (it uses MAPI).  On Unix, it requires the xdg-email utility.
5130
5134
    If the preferred client can't be found (or used), your editor will be used.
5131
5135
 
5132
5136
    To use a specific mail program, set the mail_client configuration option.