changeset 29:2a5c0bf0fef5

Another way of fixing no-bookmark issue, along with updated test.
author Augie Fackler <durin42@gmail.com>
date Tue, 28 Apr 2009 06:30:11 -0700
parents b258ef16ae37
children 578d1ebb6d69
files git_handler.py tests/test-sane-without-bookmarks.out
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/git_handler.py	Tue Apr 28 06:26:21 2009 -0700
+++ b/git_handler.py	Tue Apr 28 06:30:11 2009 -0700
@@ -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
--- a/tests/test-sane-without-bookmarks.out	Tue Apr 28 06:26:21 2009 -0700
+++ b/tests/test-sane-without-bookmarks.out	Tue Apr 28 06:30:11 2009 -0700
@@ -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>