812
812
create_shared_repository(to_root)
813
813
except NoRepositoryPresent:
814
814
raise BzrCommandError("Can't create repository at existing branch.")
815
for version in pybaz.Archive(str(from_archive)).iter_versions():
816
if not selected(version):
817
print "Skipping %s" % version
819
target = os.path.join(to_root, map_namespace(version))
820
printer("importing %s into %s" % (version, target))
821
if not os.path.exists(os.path.dirname(target)):
822
os.makedirs(os.path.dirname(target))
824
import_version(target, version, printer,
825
reuse_history_from=reuse_history_from,
826
standalone=standalone)
827
except pybaz.errors.ExecProblem,e:
828
if str(e).find('The requested revision cannot be built.') != -1:
829
printer("Skipping version %s as it cannot be built due"
830
" to a missing parent archive." % version)
834
if str(e).find('already exists, and the last revision ') != -1:
835
printer("Skipping version %s as it has had commits made"
836
" since it was converted to bzr." % version)
815
versions = list(pybaz.Archive(str(from_archive)).iter_versions())
816
# progress_bar = bzrlib.ui.ui_factory.nested_progress_bar()
818
for num, version in enumerate(versions):
819
# progress_bar.update("Branch", num, len(versions))
820
if not selected(version):
821
print "Skipping %s" % version
823
target = os.path.join(to_root, map_namespace(version))
824
printer("importing %s into %s" % (version, target))
825
if not os.path.exists(os.path.dirname(target)):
826
os.makedirs(os.path.dirname(target))
828
import_version(target, version, printer,
829
reuse_history_from=reuse_history_from,
830
standalone=standalone)
831
except pybaz.errors.ExecProblem,e:
832
if str(e).find('The requested revision cannot be built.') != -1:
833
printer("Skipping version %s as it cannot be built due"
834
" to a missing parent archive." % version)
838
if str(e).find('already exists, and the last revision ') != -1:
839
printer("Skipping version %s as it has had commits made"
840
" since it was converted to bzr." % version)
845
# progress_bar.finished()
841
847
def map_namespace(a_version):
842
848
a_version = pybaz.Version("%s" % a_version)