~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/versionedfile.py

  • Committer: Vincent Ladeuil
  • Date: 2010-10-08 10:50:51 UTC
  • mfrom: (5050.17.31 2.2.2-dev)
  • mto: This revision was merged to the branch mainline in revision 5474.
  • Revision ID: v.ladeuil+lp@free.fr-20101008105051-xd4knkrohzclffic
Merge 2.2 into trunk including fixes for bug #651706 and bug #646133

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2011 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
 
2
#
 
3
# Authors:
 
4
#   Johan Rydberg <jrydberg@gnu.org>
2
5
#
3
6
# This program is free software; you can redistribute it and/or modify
4
7
# it under the terms of the GNU General Public License as published by
927
930
 
928
931
    The use of tuples allows a single code base to support several different
929
932
    uses with only the mapping logic changing from instance to instance.
930
 
 
931
 
    :ivar _immediate_fallback_vfs: For subclasses that support stacking,
932
 
        this is a list of other VersionedFiles immediately underneath this
933
 
        one.  They may in turn each have further fallbacks.
934
933
    """
935
934
 
936
935
    def add_lines(self, key, parents, lines, parent_texts=None,
1194
1193
    def _extract_blocks(self, version_id, source, target):
1195
1194
        return None
1196
1195
 
1197
 
    def _transitive_fallbacks(self):
1198
 
        """Return the whole stack of fallback versionedfiles.
1199
 
 
1200
 
        This VersionedFiles may have a list of fallbacks, but it doesn't
1201
 
        necessarily know about the whole stack going down, and it can't know
1202
 
        at open time because they may change after the objects are opened.
1203
 
        """
1204
 
        all_fallbacks = []
1205
 
        for a_vfs in self._immediate_fallback_vfs:
1206
 
            all_fallbacks.append(a_vfs)
1207
 
            all_fallbacks.extend(a_vfs._transitive_fallbacks())
1208
 
        return all_fallbacks
1209
 
 
1210
1196
 
1211
1197
class ThunkedVersionedFiles(VersionedFiles):
1212
1198
    """Storage for many versioned files thunked onto a 'VersionedFile' class.