/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: Robert Collins
  • Date: 2007-09-27 21:11:38 UTC
  • mfrom: (2871 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2879.
  • Revision ID: robertc@robertcollins.net-20070927211138-ebsu1bo1qz9f1w8n
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1430
1430
               help='Pass these options to the external diff program.'),
1431
1431
        Option('prefix', type=str,
1432
1432
               short_name='p',
1433
 
               help='Set prefixes to added to old and new filenames, as '
 
1433
               help='Set prefixes added to old and new filenames, as '
1434
1434
                    'two values separated by a colon. (eg "old/:new/").'),
1435
1435
        'revision',
1436
1436
        'change',
2701
2701
    _see_also = ['update', 'remerge', 'status-flags']
2702
2702
    takes_args = ['branch?']
2703
2703
    takes_options = [
 
2704
        'change',
2704
2705
        'revision',
2705
2706
        Option('force',
2706
2707
               help='Merge even if the destination tree has uncommitted changes.'),
3048
3049
 
3049
3050
    _see_also = ['cat', 'export']
3050
3051
    takes_options = [
3051
 
            'revision',
3052
 
            Option('no-backup', "Do not save backups of reverted files."),
3053
 
            ]
 
3052
        'revision',
 
3053
        Option('no-backup', "Do not save backups of reverted files."),
 
3054
        Option('forget-merges',
 
3055
               'Remove pending merge marker, without changing any files.'),
 
3056
        ]
3054
3057
    takes_args = ['file*']
3055
3058
 
3056
 
    def run(self, revision=None, no_backup=False, file_list=None):
3057
 
        if file_list is not None:
3058
 
            if len(file_list) == 0:
3059
 
                raise errors.BzrCommandError("No files specified")
3060
 
        
 
3059
    def run(self, revision=None, no_backup=False, file_list=None,
 
3060
            forget_merges=None):
3061
3061
        tree, file_list = tree_files(file_list)
 
3062
        if forget_merges:
 
3063
            tree.set_parent_ids(tree.get_parent_ids()[:1])
 
3064
        else:
 
3065
            self._revert_tree_to_revision(tree, revision, file_list, no_backup)
 
3066
 
 
3067
    @staticmethod
 
3068
    def _revert_tree_to_revision(tree, revision, file_list, no_backup):
3062
3069
        if revision is None:
3063
 
            # FIXME should be tree.last_revision
3064
3070
            rev_id = tree.last_revision()
3065
3071
        elif len(revision) != 1:
3066
3072
            raise errors.BzrCommandError('bzr revert --revision takes exactly 1 argument')
3068
3074
            rev_id = revision[0].in_history(tree.branch).rev_id
3069
3075
        pb = ui.ui_factory.nested_progress_bar()
3070
3076
        try:
3071
 
            tree.revert(file_list, 
 
3077
            tree.revert(file_list,
3072
3078
                        tree.branch.repository.revision_tree(rev_id),
3073
3079
                        not no_backup, pb, report_changes=True)
3074
3080
        finally:
4185
4191
    def run(self, location=None, target_type=None, bind_to=None, force=False):
4186
4192
        directory = bzrdir.BzrDir.open(location)
4187
4193
        if target_type is None:
4188
 
            raise BzrCommandError('No target configuration specified')
 
4194
            raise errors.BzrCommandError('No target configuration specified')
4189
4195
        elif target_type == 'branch':
4190
4196
            reconfiguration = reconfigure.Reconfigure.to_branch(directory)
4191
4197
        elif target_type == 'tree':