Rev 419: Bring in the recent history-db fixes. in http://bazaar.launchpad.net/~jameinel/loggerhead/integration
John Arbash Meinel
john at arbash-meinel.com
Tue May 4 16:38:41 BST 2010
At http://bazaar.launchpad.net/~jameinel/loggerhead/integration
------------------------------------------------------------
revno: 419 [merge]
revision-id: john at arbash-meinel.com-20100504153832-t9jvm8ctl9qeihyd
parent: john at arbash-meinel.com-20100503204255-xqqrtvdt33k3v768
parent: john at arbash-meinel.com-20100504153703-d2cpu7crcm4eit3s
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: integration
timestamp: Tue 2010-05-04 10:38:32 -0500
message:
Bring in the recent history-db fixes.
modified:
loggerhead/history.py history.py-20061211064342-102iqirsciyvgtcf-5
-------------- next part --------------
=== modified file 'loggerhead/history.py'
--- a/loggerhead/history.py 2010-05-03 20:42:55 +0000
+++ b/loggerhead/history.py 2010-05-04 15:38:32 +0000
@@ -309,7 +309,6 @@
# simpler...
self._querier.ensure_branch_tip()
self._branch_nick = self._branch.get_config().get_nickname()
- self._show_merge_points = show_merge_points
self.log = logging.getLogger('loggerhead.%s' % (self._branch_nick,))
self.last_revid = branch.last_revision()
@@ -354,10 +353,14 @@
# querier returns dotted revno tuples
query_revno_map = self._querier.get_dotted_revno_range_multi(
unknown)
+ ghosts = set(revids)
for revid, dotted_revno in query_revno_map.iteritems():
revno_str = '.'.join(map(str, dotted_revno))
self._revno_revid_cache.set(revid, revno_str)
revno_map[revid] = revno_str
+ ghosts.discard(revids)
+ if ghosts:
+ revno_map.update([(n, 'unknown') for n in ghosts])
return revno_map
def get_revid_for_revno(self, revno_str):
@@ -368,7 +371,7 @@
revnos = self._querier.get_revision_ids([dotted_revno])
revnos = dict([('.'.join(map(str, drn)), ri)
for drn, ri in revnos.iteritems()])
- for revno_str, revid in revnos:
+ for revno_str, revid in revnos.iteritems():
self._revno_revid_cache.set(revid, revno_str)
return revnos[revno_str]
@@ -450,7 +453,7 @@
return self.last_revid
try:
if self.revno_re.match(revid):
- val = self.get_revid_for_revno([revid])[revid]
+ val = self.get_revid_for_revno(revid)
# XXX: Do this more cleanly
if val is None:
raise KeyError
@@ -683,10 +686,7 @@
parity = 0
for change in changes:
- if self._show_merge_points:
- change._set_property('merge_points', merge_points_callback)
- else:
- change.merge_points = []
+ change._set_property('merge_points', merge_points_callback)
if len(change.parents) > 0:
change.parents = [util.Container(revid=r, revno=revno_map[r])
for r in change.parents]
More information about the bazaar-commits
mailing list