summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2011-07-20 16:33:45 +0200
committerJelmer Vernooij <jelmer@samba.org>2011-07-20 16:33:45 +0200
commit8d055e5eae00c2bed564d28f39ba254a40297e08 (patch)
tree8dc16ffcaa220c675f7fa3ed6de287a8983469bd
parentc4cb0914d8bdedfcd3f209f123a83bae1bee0ae8 (diff)
downloadbzr-fastimport-8d055e5eae00c2bed564d28f39ba254a40297e08.tar.gz
Avoid deprecated Repository.iter_reverse_revision_history.
-rw-r--r--branch_updater.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/branch_updater.py b/branch_updater.py
index caf720f..680f10f 100644
--- a/branch_updater.py
+++ b/branch_updater.py
@@ -152,8 +152,12 @@ class BranchUpdater(object):
"""
from fastimport.helpers import single_plural
last_rev_id = self.cache_mgr.lookup_committish(last_mark)
- revs = list(self.repo.iter_reverse_revision_history(last_rev_id))
- revno = len(revs)
+ self.repo.lock_read()
+ try:
+ graph = self.repo.get_graph()
+ revno = graph.find_distance_to_null(last_rev_id, [])
+ finally:
+ self.repo.unlock()
existing_revno, existing_last_rev_id = br.last_revision_info()
changed = False
if revno != existing_revno or last_rev_id != existing_last_rev_id: