~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

(gz) Create working tree at specified revision when doing a local push
 (Martin Packman)

Show diffs side-by-side

added added

removed removed

Lines of Context:
685
685
            if revision:
686
686
                if len(revision) != 1:
687
687
                    raise errors.BzrCommandError(gettext(
688
 
                        "Revision numbers only make sense for single "
689
 
                        "revisions, not ranges"))
 
688
                        "Tags can only be placed on a single revision, "
 
689
                        "not on a range"))
690
690
                revid = revision[0].as_revision_id(b)
691
691
            else:
692
692
                revid = b.last_revision()
1184
1184
            tree_to = None
1185
1185
            branch_to = Branch.open_containing(directory)[0]
1186
1186
            self.add_cleanup(branch_to.lock_write().unlock)
1187
 
            if show_base:
1188
 
                warning(gettext("No working tree, ignoring --show-base"))
 
1187
 
 
1188
        if tree_to is None and show_base:
 
1189
            raise errors.BzrCommandError(gettext("Need working tree for --show-base."))
1189
1190
 
1190
1191
        if local and not branch_to.get_bound_location():
1191
1192
            raise errors.LocalRequiresBoundBranch()
1870
1871
            title='Deletion Strategy', value_switches=True, enum_switch=False,
1871
1872
            safe='Backup changed files (default).',
1872
1873
            keep='Delete from bzr but leave the working copy.',
1873
 
            no_backup='Don\'t backup changed files.'),
1874
 
        ]
 
1874
            no_backup='Don\'t backup changed files.',
 
1875
            force='Delete all the specified files, even if they can not be '
 
1876
                'recovered and even if they are non-empty directories. '
 
1877
                '(deprecated, use no-backup)')]
1875
1878
    aliases = ['rm', 'del']
1876
1879
    encoding_type = 'replace'
1877
1880
 
1878
1881
    def run(self, file_list, verbose=False, new=False,
1879
1882
        file_deletion_strategy='safe'):
 
1883
        if file_deletion_strategy == 'force':
 
1884
            note(gettext("(The --force option is deprecated, rather use --no-backup "
 
1885
                "in future.)"))
 
1886
            file_deletion_strategy = 'no-backup'
1880
1887
 
1881
1888
        tree, file_list = WorkingTree.open_containing_paths(file_list)
1882
1889
 
2328
2335
            help='Diff format to use.',
2329
2336
            lazy_registry=('bzrlib.diff', 'format_registry'),
2330
2337
            title='Diff format'),
2331
 
        Option('context',
2332
 
            help='How many lines of context to show.',
2333
 
            type=int,
2334
 
            ),
2335
2338
        ]
2336
2339
    aliases = ['di', 'dif']
2337
2340
    encoding_type = 'exact'
2338
2341
 
2339
2342
    @display_command
2340
2343
    def run(self, revision=None, file_list=None, diff_options=None,
2341
 
            prefix=None, old=None, new=None, using=None, format=None, 
2342
 
            context=None):
 
2344
            prefix=None, old=None, new=None, using=None, format=None):
2343
2345
        from bzrlib.diff import (get_trees_and_branches_to_diff_locked,
2344
2346
            show_diff_trees)
2345
2347
 
2378
2380
                               old_label=old_label, new_label=new_label,
2379
2381
                               extra_trees=extra_trees,
2380
2382
                               path_encoding=path_encoding,
2381
 
                               using=using, context=context,
 
2383
                               using=using,
2382
2384
                               format_cls=format)
2383
2385
 
2384
2386
 
5140
5142
            Option('strict',
5141
5143
                   help='Produce a strict-format testament.')]
5142
5144
    takes_args = ['branch?']
5143
 
    encoding_type = 'exact'
5144
5145
    @display_command
5145
5146
    def run(self, branch=u'.', revision=None, long=False, strict=False):
5146
5147
        from bzrlib.testament import Testament, StrictTestament
5159
5160
            rev_id = revision[0].as_revision_id(b)
5160
5161
        t = testament_class.from_revision(b.repository, rev_id)
5161
5162
        if long:
5162
 
            self.outf.writelines(t.as_text_lines())
 
5163
            sys.stdout.writelines(t.as_text_lines())
5163
5164
        else:
5164
 
            self.outf.write(t.as_short_text())
 
5165
            sys.stdout.write(t.as_short_text())
5165
5166
 
5166
5167
 
5167
5168
class cmd_annotate(Command):
6727
6728
        ('cmd_version_info', [], 'bzrlib.cmd_version_info'),
6728
6729
        ('cmd_resolve', ['resolved'], 'bzrlib.conflicts'),
6729
6730
        ('cmd_conflicts', [], 'bzrlib.conflicts'),
6730
 
        ('cmd_ping', [], 'bzrlib.smart.ping'),
6731
6731
        ('cmd_sign_my_commits', [], 'bzrlib.commit_signature_commands'),
6732
6732
        ('cmd_verify_signatures', [], 'bzrlib.commit_signature_commands'),
6733
6733
        ('cmd_test_script', [], 'bzrlib.cmd_test_script'),