Mercurial > hg > hg-git
diff hggit/git_handler.py @ 1026:e7a8a5710257
wlock: use non-context-manager form to restore older hg support
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Mon, 24 Jul 2017 15:07:44 -0500 (2017-07-24) |
parents | 078c3912afce |
children | fa08148bc5fc |
line wrap: on
line diff
--- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -197,7 +197,8 @@ self._map_hg_real = map_hg_real def save_map(self, map_file): - with self.repo.wlock(): + wlock = self.repo.wlock() + try: file = self.repo.vfs(map_file, 'w+', atomictemp=True) map_hg = self._map_hg buf = cStringIO.StringIO() @@ -208,6 +209,8 @@ buf.close() # If this complains, atomictempfile no longer has close file.close() + finally: + wlock.release() def load_tags(self): self.tags = {}