Rev 140: iter_merge_sorted doesn't handle non-mainline stop revs properly. in http://bazaar.launchpad.net/%2Bbranch/bzr-history-db

John Arbash Meinel john at arbash-meinel.com
Tue May 31 13:31:58 UTC 2011


At http://bazaar.launchpad.net/%2Bbranch/bzr-history-db

------------------------------------------------------------
revno: 140
revision-id: john at arbash-meinel.com-20110531133143-07fsxhdnp0hxnjbj
parent: john at arbash-meinel.com-20110531094008-43i8x9acs9k1u4xh
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: bzr-history-db
timestamp: Tue 2011-05-31 15:31:43 +0200
message:
  iter_merge_sorted doesn't handle non-mainline stop revs properly.
  Punt.
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2011-05-31 09:40:08 +0000
+++ b/__init__.py	2011-05-31 13:31:43 +0000
@@ -181,6 +181,15 @@
                 real_stop_revision_id = stop_revision_id
             else:
                 real_stop_revision_id = parents[0]
+            revno = self._do_revision_id_to_dotted_revno(stop_revision_id)
+            if len(revno) != 1:
+                if 'history_db' in debug.debug_flags:
+                    trace.note('falling back to _orig_iter_merge_sorted'
+                               ' for a non-mainline stop_revision_id')
+                return _orig_iter_merge_sorted(self,
+                    start_revision_id=start_revision_id,
+                    stop_revision_id=stop_revision_id, stop_rule=stop_rule,
+                    direction=direction)
     merge_sorted = query.iter_merge_sorted_revisions(
                     start_revision_id=start_revision_id,
                     stop_revision_id=real_stop_revision_id)
@@ -252,7 +261,7 @@
                    ' %.3fs to query' % (t2-t0, t1-t0, t2-t1))
     self._partial_revision_id_to_revno_cache.update(
         [(r_id, r_no) for r_no, r_id in revno_map.iteritems()])
-               
+
     if revno not in revno_map:
         trace.mutter('history_db failed to find a mapping for %s,'
                      'falling back' % (revno,))



More information about the bazaar-commits mailing list