changeset 589:96e75caaf900

git_handler: add bookmark compatibility with new bmstore (issue #60) Prior to this fix, tests against the latest hg codebase would fail with: creating bookmarks failed, do you have bookmarks enabled?
author David M. Carr <david@carrclan.us>
date Thu, 22 Nov 2012 18:44:09 -0500
parents 1ab57b19cb3a
children 2320ab6ada36
files hggit/git_handler.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/git_handler.py	Sun Nov 11 15:46:19 2012 -0600
+++ b/hggit/git_handler.py	Thu Nov 22 18:44:09 2012 -0500
@@ -1044,7 +1044,10 @@
                     bookmarks.write(self.repo, bms)
                 else:
                     self.repo._bookmarks = bms
-                    bookmarks.write(self.repo)
+                    if getattr(bms, 'write', None): # hg >= 2.5
+                        bms.write()
+                    else: # hg < 2.5
+                        bookmarks.write(self.repo)
 
         except AttributeError:
             self.ui.warn(_('creating bookmarks failed, do you have'