# HG changeset patch # User Augie Fackler <durin42@gmail.com> # Date 1240925411 25200 # Tue Apr 28 06:30:11 2009 -0700 # Node ID 2a5c0bf0fef55a70bdc128cbb324b0943fcdfd03 # Parent b258ef16ae37b7ad0839fcc1b390296537898e71 Another way of fixing no-bookmark issue, along with updated test. diff --git a/git_handler.py b/git_handler.py --- 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 --- a/tests/test-sane-without-bookmarks.out +++ b/tests/test-sane-without-bookmarks.out @@ -1,13 +1,15 @@ 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 -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>