~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/history.py

  • Committer: Martin Albisetti
  • Date: 2008-08-20 22:11:54 UTC
  • mto: This revision was merged to the branch mainline in revision 218.
  • Revision ID: argentina@gmail.com-20080820221154-qxxgkd06k0b4a2wg
Add --prefix option for hosts

Show diffs side-by-side

added added

removed removed

Lines of Context:
257
257
            revid = parents[0]
258
258
 
259
259
    def get_short_revision_history_by_fileid(self, file_id):
260
 
        # wow.  is this really the only way we can get this list?  by
261
 
        # man-handling the weave store directly? :-0
262
260
        # FIXME: would be awesome if we could get, for a folder, the list of
263
 
        # revisions where items within that folder changed.
264
 
        possible_keys = [(file_id, revid) for revid in self._full_history]
265
 
        existing_keys = self._branch.repository.texts.get_parent_map(possible_keys)
266
 
        return [revid for _, revid in existing_keys.iterkeys()]
 
261
        # revisions where items within that folder changed.i
 
262
        try:
 
263
            # FIXME: Workaround for bzr versions prior to 1.6b3. 
 
264
            # Remove me eventually pretty please  :)
 
265
            w = self._branch.repository.weave_store.get_weave(file_id, self._branch.repository.get_transaction())
 
266
            w_revids = w.versions() 
 
267
            revids = [r for r in self._full_history if r in w_revids] 
 
268
        except AttributeError:
 
269
            possible_keys = [(file_id, revid) for revid in self._full_history]
 
270
            existing_keys = self._branch.repository.texts.get_parent_map(possible_keys)
 
271
            revids = [revid for _, revid in existing_keys.iterkeys()]
 
272
        return revids
267
273
 
268
274
    def get_revision_history_since(self, revid_list, date):
269
275
        # if a user asks for revisions starting at 01-sep, they mean inclusive,