~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:21:09 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-20050913142108-729a66c4a145f1b3
baz-import twice should work

Show diffs side-by-side

added added

removed removed

Lines of Context:
585
585
        print name
586
586
 
587
587
    def run(self, to_root_dir, from_archive, verbose=False):
588
 
        to_root = os.path.realpath(to_root_dir)
 
588
        to_root = str(os.path.realpath(to_root_dir))
589
589
        if not os.path.exists(to_root):
590
590
            os.mkdir(to_root)
591
591
        import_archive(to_root, from_archive, verbose, self.printer)
592
592
 
593
593
def import_archive(to_root, from_archive, verbose, printer):
594
 
    for version in pybaz.Archive(from_archive).iter_versions():
 
594
    for version in pybaz.Archive(str(from_archive)).iter_versions():
595
595
        target = os.path.join(to_root, map_namespace(version))
596
596
        printer("importing %s into %s" % (version, target))
597
 
        os.makedirs(os.path.dirname(target))
 
597
        if not os.path.exists(os.path.dirname(target)):
 
598
            os.makedirs(os.path.dirname(target))
598
599
        import_version(target, version, printer)
599
600
 
600
601
def map_namespace(a_version):