# HG changeset patch
# User Sean Farley <sean@farley.io>
# Date 1443137067 25200
#      Thu Sep 24 16:24:27 2015 -0700
# Node ID 674f799afb040ca48381f1e101e264fb2ac12382
# Parent  7b89630a2a48d963ba3ba8be006e60880325e326
update_hg_bookmarks: add wlock

diff --git a/hggit/git_handler.py b/hggit/git_handler.py
--- a/hggit/git_handler.py
+++ b/hggit/git_handler.py
@@ -1299,7 +1299,11 @@
                         bms[head + suffix] = hgsha
 
             if heads:
-                bms.write()
+                wlock = self.repo.wlock()
+                try:
+                    bms.write()
+                finally:
+                    wlock.release()
 
         except AttributeError:
             self.ui.warn(_('creating bookmarks failed, do you have'