/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: Jelmer Vernooij
  • Date: 2009-04-03 15:18:15 UTC
  • mfrom: (4242 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4250.
  • Revision ID: jelmer@samba.org-20090403151815-guc4htxlhkgwehvd
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
722
722
    takes_args = ['names*']
723
723
    takes_options = [Option("after", help="Move only the bzr identifier"
724
724
        " of the file, because the file has already been moved."),
 
725
        Option('auto', help='Automatically guess renames.'),
 
726
        Option('dry-run', help='Avoid making changes when guessing renames.'),
725
727
        ]
726
728
    aliases = ['move', 'rename']
727
729
    encoding_type = 'replace'
728
730
 
729
 
    def run(self, names_list, after=False):
 
731
    def run(self, names_list, after=False, auto=False, dry_run=False):
 
732
        if auto:
 
733
            return self.run_auto(names_list, after, dry_run)
 
734
        elif dry_run:
 
735
            raise errors.BzrCommandError('--dry-run requires --auto.')
730
736
        if names_list is None:
731
737
            names_list = []
732
 
 
733
738
        if len(names_list) < 2:
734
739
            raise errors.BzrCommandError("missing file argument")
735
740
        tree, rel_names = tree_files(names_list, canonicalize=False)
739
744
        finally:
740
745
            tree.unlock()
741
746
 
 
747
    def run_auto(self, names_list, after, dry_run):
 
748
        if names_list is not None and len(names_list) > 1:
 
749
            raise errors.BzrCommandError('Only one path may be specified to'
 
750
                                         ' --auto.')
 
751
        if after:
 
752
            raise errors.BzrCommandError('--after cannot be specified with'
 
753
                                         ' --auto.')
 
754
        work_tree, file_list = tree_files(names_list, default_branch='.')
 
755
        work_tree.lock_write()
 
756
        try:
 
757
            rename_map.RenameMap.guess_renames(work_tree, dry_run)
 
758
        finally:
 
759
            work_tree.unlock()
 
760
 
742
761
    def _run(self, tree, names_list, rel_names, after):
743
762
        into_existing = osutils.isdir(names_list[-1])
744
763
        if into_existing and len(names_list) == 2:
1301
1320
      basic statistics (like the number of files in the working tree and
1302
1321
      number of revisions in the branch and repository):
1303
1322
 
1304
 
        bzr -v info
 
1323
        bzr info -v
1305
1324
 
1306
1325
      Display the above together with number of committers to the branch:
1307
1326
 
1308
 
        bzr -vv info
 
1327
        bzr info -vv
1309
1328
    """
1310
1329
    _see_also = ['revno', 'working-trees', 'repositories']
1311
1330
    takes_args = ['location?']
3916
3935
            type=_parse_revision_str,
3917
3936
            help='Filter on local branch revisions (inclusive). '
3918
3937
                'See "help revisionspec" for details.'),
3919
 
        Option('include-merges', 'Show merged revisions.'),
 
3938
        Option('include-merges',
 
3939
               'Show all revisions in addition to the mainline ones.'),
3920
3940
        ]
3921
3941
    encoding_type = 'replace'
3922
3942
 
5267
5287
            urlutils.unescape_for_display(to_branch.base, 'utf-8'))
5268
5288
 
5269
5289
 
5270
 
class cmd_guess_renames(Command):
5271
 
    """Guess which files have been have been renamed, based on their content.
5272
 
 
5273
 
    Only versioned files which have been deleted are candidates for rename
5274
 
    detection, and renames to ignored files will not be detected.
5275
 
    """
5276
 
 
5277
 
    def run(self):
5278
 
        work_tree, file_list = tree_files(None, default_branch='.')
5279
 
        work_tree.lock_write()
5280
 
        try:
5281
 
            rename_map.RenameMap.guess_renames(work_tree)
5282
 
        finally:
5283
 
            work_tree.unlock()
5284
 
 
5285
 
 
5286
5290
class cmd_view(Command):
5287
5291
    """Manage filtered views.
5288
5292