diff --git a/git_handler.py b/git_handler.py index b258ef16ae37b7ad0839fcc1b390296537898e71_Z2l0X2hhbmRsZXIucHk=..2a5c0bf0fef55a70bdc128cbb324b0943fcdfd03_Z2l0X2hhbmRsZXIucHk= 100644 --- a/git_handler.py +++ b/git_handler.py @@ -320,7 +320,11 @@ hgsha = hex_to_sha(self.map_hg_get(sha)) if not head == 'HEAD': bms[remote_name + '/' + head] = hgsha - bookmarks.write(self.repo, bms) + try: + bookmarks.write(self.repo, bms) + except AttributeError: + self.repo.ui.warn('creating bookmarks failed, do you have' + ' bookmarks enabled?\n') def import_git_commit(self, commit): print "importing: " + commit.id diff --git a/tests/test-sane-without-bookmarks.out b/tests/test-sane-without-bookmarks.out index b258ef16ae37b7ad0839fcc1b390296537898e71_dGVzdHMvdGVzdC1zYW5lLXdpdGhvdXQtYm9va21hcmtzLm91dA==..2a5c0bf0fef55a70bdc128cbb324b0943fcdfd03_dGVzdHMvdGVzdC1zYW5lLXdpdGhvdXQtYm9va21hcmtzLm91dA== 100644 --- a/tests/test-sane-without-bookmarks.out +++ b/tests/test-sane-without-bookmarks.out @@ -1,9 +1,10 @@ Initialized empty Git repository in gitrepo/.git/ fetching from : origin +exporting git objects Counting objects: 6, done. Compressing objects: 33% (1/3) Compressing objects: 66% (2/3) Compressing objects: 100% (3/3) Compressing objects: 100% (3/3), done. Total 6 (delta 0), reused 0 (delta 0) importing Git objects into Hg importing: 7eeab2ea75ec1ac0ff3d500b5b6f8a3447dd7c03 importing: 9497a4ee62e16ee641860d7677cdb2589ea15554 @@ -4,10 +5,11 @@ Counting objects: 6, done. Compressing objects: 33% (1/3) Compressing objects: 66% (2/3) Compressing objects: 100% (3/3) Compressing objects: 100% (3/3), done. Total 6 (delta 0), reused 0 (delta 0) importing Git objects into Hg importing: 7eeab2ea75ec1ac0ff3d500b5b6f8a3447dd7c03 importing: 9497a4ee62e16ee641860d7677cdb2589ea15554 -bookmarks are not enabled, not writing them out!2 files updated, 0 files merged, 0 files removed, 0 files unresolved +creating bookmarks failed, do you have bookmarks enabled? +2 files updated, 0 files merged, 0 files removed, 0 files unresolved @ changeset: 1:7bcd915dc873 | tag: tip | user: test <test@example.org>