|
17 | 17 | import sys |
18 | 18 |
|
19 | 19 | import bzrlib |
20 | | -bzrlib.initialize() |
| 20 | +if hasattr(bzrlib, "initialize"): |
| 21 | + bzrlib.initialize() |
21 | 22 |
|
22 | 23 | import bzrlib.plugin |
23 | 24 | bzrlib.plugin.load_plugins() |
@@ -553,7 +554,7 @@ def parse_commit(parser): |
553 | 554 |
|
554 | 555 | repo.lock_write() |
555 | 556 | try: |
556 | | - builder = repo.get_commit_builder(parents, None, date, tz, committer, props, revid, False) |
| 557 | + builder = repo.get_commit_builder(parents, None, date, tz, committer, props, revid) |
557 | 558 | try: |
558 | 559 | list(builder.record_iter_changes(mtree, mtree.last_revision(), changes)) |
559 | 560 | builder.finish_inventory() |
@@ -612,7 +613,10 @@ def do_export(parser): |
612 | 613 | if ref == 'refs/heads/master': |
613 | 614 | repo.generate_revision_history(revid, marks.get_tip('master')) |
614 | 615 | revno, revid = repo.last_revision_info() |
615 | | - peer.import_last_revision_info_and_tags(repo, revno, revid) |
| 616 | + if hasattr(peer, "import_last_revision_info_and_tags"): |
| 617 | + peer.import_last_revision_info_and_tags(repo, revno, revid) |
| 618 | + else: |
| 619 | + peer.import_last_revision_info(repo.repository, revno, revid) |
616 | 620 | wt = peer.bzrdir.open_workingtree() |
617 | 621 | wt.update() |
618 | 622 | print "ok %s" % ref |
@@ -646,12 +650,12 @@ def get_repo(url, alias): |
646 | 650 | global dirname, peer |
647 | 651 |
|
648 | 652 | clone_path = os.path.join(dirname, 'clone') |
649 | | - origin = bzrlib.controldir.ControlDir.open(url) |
| 653 | + origin = bzrlib.bzrdir.BzrDir.open(url) |
650 | 654 | remote_branch = origin.open_branch() |
651 | 655 |
|
652 | 656 | if os.path.exists(clone_path): |
653 | 657 | # pull |
654 | | - d = bzrlib.controldir.ControlDir.open(clone_path) |
| 658 | + d = bzrlib.bzrdir.BzrDir.open(clone_path) |
655 | 659 | branch = d.open_branch() |
656 | 660 | result = branch.pull(remote_branch, [], None, False) |
657 | 661 | else: |
|
0 commit comments