~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2007-07-12 12:07:13 UTC
  • mto: This revision was merged to the branch mainline in revision 2610.
  • Revision ID: robertc@robertcollins.net-20070712120713-c2vfm2n61l63wt6s
(robertc) Introduce a pack command.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3023
3023
        return status_code
3024
3024
 
3025
3025
 
 
3026
class cmd_pack(Command):
 
3027
    """Compress the data within a repository."""
 
3028
 
 
3029
    _see_also = ['repositories']
 
3030
    takes_args = ['branch_or_repo?']
 
3031
 
 
3032
    def run(self, branch_or_repo='.'):
 
3033
        dir = bzrdir.BzrDir.open_containing(branch_or_repo)[0]
 
3034
        try:
 
3035
            branch = dir.open_branch()
 
3036
            repository = branch.repository
 
3037
        except errors.NotBranchError:
 
3038
            repository = dir.open_repository()
 
3039
        repository.pack()
 
3040
 
 
3041
 
3026
3042
class cmd_plugins(Command):
3027
3043
    """List plugins"""
3028
3044
    hidden = True