remote-bzr: fix order of locking in CustomTree
authorFelipe Contreras <felipe.contreras@gmail.com>
Wed, 1 May 2013 01:09:55 +0000 (20:09 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 May 2013 05:06:46 +0000 (22:06 -0700)
It doesn't seem to make any difference, but revision_tree() requires a
lock.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/remote-helpers/git-remote-bzr
index 91b5cda7671f6a4169ce8ec02de987242ef5f9f5..b428244cac93c266f1118315503def6ffea1cf7a 100755 (executable)
@@ -389,8 +389,8 @@ class CustomTree():
 
         def copy_tree(revid):
             files = files_cache[revid] = {}
-            tree = repo.repository.revision_tree(revid)
             repo.lock_read()
+            tree = repo.repository.revision_tree(revid)
             try:
                 for path, entry in tree.iter_entries_by_dir():
                     files[path] = entry.file_id