~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to baz_import.py

  • Committer: Robert Collins
  • Date: 2005-09-13 14:00:45 UTC
  • mto: (147.2.6) (364.1.3 bzrtools)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: robertc@robertcollins.net-20050913140044-c7d2289742935b0c
archive at a time imports

Show diffs side-by-side

added added

removed removed

Lines of Context:
582
582
        to_root = os.path.realpath(to_root_dir)
583
583
        if not os.path.exists(to_root):
584
584
            os.mkdir(to_root)
585
 
        return
586
 
        if from_branch is not None:
587
 
            try:
588
 
                from_branch = pybaz.Version(from_branch)
589
 
            except pybaz.errors.NamespaceError:
590
 
                print "%s is not a valid Arch branch." % from_branch
591
 
                return 1
592
 
        import_version(to_location, from_branch)
 
585
        import_archive(to_root, from_archive, verbose)
 
586
 
 
587
def import_archive(to_root, from_archive, verbose):
 
588
    for version in pybaz.Archive(from_archive).iter_versions():
 
589
        target = os.path.join(to_root, map_namespace(version))
 
590
        os.makedirs(os.path.dirname(target))
 
591
        import_version(target, version)
593
592
 
594
593
def map_namespace(a_version):
595
594
    a_version = pybaz.Version("%s" % a_version)