changeset 982:7a767993352b

git_handler: use util method for writing bookmarks
author Sean Farley <sean@farley.io>
date Fri, 08 Jan 2016 13:59:39 -0800
parents 0b957c2d151a
children 296349f421c8
files hggit/git_handler.py
diffstat 1 files changed, 1 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/git_handler.py
+++ b/hggit/git_handler.py
@@ -23,7 +23,6 @@
     context,
     encoding,
     util as hgutil,
-    lock as lockmod,
     url,
 )
 
@@ -1320,19 +1319,7 @@
                         bms[head + suffix] = hgsha
 
             if heads:
-                tr = lock = wlock = None
-                try:
-                    wlock = self.repo.wlock()
-                    lock = self.repo.lock()
-                    tr = self.repo.transaction('git_handler')
-                    if hgutil.safehasattr(bms, 'recordchange'):
-                        # recordchange was added in mercurial 3.2
-                        bms.recordchange(tr)
-                    else:
-                        bms.write()
-                    tr.close()
-                finally:
-                    lockmod.release(tr, lock, wlock)
+                util.recordbookmarks(self.repo, bms)
 
         except AttributeError:
             self.ui.warn(_('creating bookmarks failed, do you have'