unbundle: move bookmark update outside the lock
authorMads Kiilerich <mads@kiilerich.com>
Sat, 12 May 2012 20:06:04 +0200
changeset 16690 de2267517841
parent 16689 f366d4c2ff34
child 16691 7d6a660ca151
unbundle: move bookmark update outside the lock d16c99f16f00 introduced updatecurrentbookmark after unbundle, but that path might end up taking a wlock after lock when writing the bookmarks.
mercurial/commands.py
--- a/mercurial/commands.py	Sat May 12 16:02:46 2012 +0200
+++ b/mercurial/commands.py	Sat May 12 20:06:04 2012 +0200
@@ -5634,9 +5634,9 @@
             f = url.open(ui, fname)
             gen = changegroup.readbundle(f, fname)
             modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname)
-        bookmarks.updatecurrentbookmark(repo, wc.node(), wc.branch())
     finally:
         lock.release()
+    bookmarks.updatecurrentbookmark(repo, wc.node(), wc.branch())
     return postincoming(ui, repo, modheads, opts.get('update'), None)
 
 @command('^update|up|checkout|co',