pack command...

Martin Pool mbp at canonical.com
Thu Sep 16 01:46:09 BST 2010


On 16 September 2010 04:38, Michael Andronov
<michael_andronov at sd-kyber.com> wrote:
> John -
>
> Thanks a lot for information provided.
> It is much clear now.
>
> One more question, if I may -
>
> Is it possible - and how? (if it is) - to invoke 'pack' using bzrlib & python.

Yes.  A good way to find how to do any thing in bzrlib is to trace
down from builtins.py, where cmd_pack has simply:

    def run(self, branch_or_repo='.', clean_obsolete_packs=False):
        dir = bzrdir.BzrDir.open_containing(branch_or_repo)[0]
        try:
            branch = dir.open_branch()
            repository = branch.repository
        except errors.NotBranchError:
            repository = dir.open_repository()
        repository.pack(clean_obsolete_packs=clean_obsolete_packs)

-- 
Martin



More information about the bazaar mailing list