# HG changeset patch
# User Mads Kiilerich <mads@kiilerich.com>
# Date 1326413947 -3600
#      Fri Jan 13 01:19:07 2012 +0100
# Node ID 2305baff673f8ae8e4e61a4dc529f2dc8cbe9574
# Parent  a153a86a472c154a3e175615ccc8798b7c7ec76d
rebase: take locks in the right order

repo.lock was taken before repo.wlock - that could in principle cause a deadlock.

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -115,8 +115,8 @@
 
     lock = wlock = None
     try:
+        wlock = repo.wlock()
         lock = repo.lock()
-        wlock = repo.wlock()
 
         # Validate input and define rebasing points
         destf = opts.get('dest', None)