~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/knitrepo.py

(gz) Remove bzrlib/util/elementtree/ package (Martin Packman)

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
from __future__ import absolute_import
 
18
 
17
19
from bzrlib.lazy_import import lazy_import
18
20
lazy_import(globals(), """
19
21
import itertools
38
40
from bzrlib.repository import (
39
41
    InterRepository,
40
42
    IsInWriteGroupError,
41
 
    RepositoryFormat,
 
43
    RepositoryFormatMetaDir,
42
44
    )
43
45
from bzrlib.vf_repository import (
44
46
    InterSameDataRepository,
181
183
        result.get_parent_map([('A',)])
182
184
        return result
183
185
 
184
 
    def fileid_involved_between_revs(self, from_revid, to_revid):
185
 
        """Find file_id(s) which are involved in the changes between revisions.
186
 
 
187
 
        This determines the set of revisions which are involved, and then
188
 
        finds all file ids affected by those revisions.
189
 
        """
190
 
        vf = self._get_revision_vf()
191
 
        from_set = set(vf.get_ancestry(from_revid))
192
 
        to_set = set(vf.get_ancestry(to_revid))
193
 
        changed = to_set.difference(from_set)
194
 
        return self._fileid_involved_by_set(changed)
195
 
 
196
 
    def fileid_involved(self, last_revid=None):
197
 
        """Find all file_ids modified in the ancestry of last_revid.
198
 
 
199
 
        :param last_revid: If None, last_revision() will be used.
200
 
        """
201
 
        if not last_revid:
202
 
            changed = set(self.all_revision_ids())
203
 
        else:
204
 
            changed = set(self.get_ancestry(last_revid))
205
 
        if None in changed:
206
 
            changed.remove(None)
207
 
        return self._fileid_involved_by_set(changed)
208
 
 
209
186
    @needs_read_lock
210
187
    def get_revision(self, revision_id):
211
188
        """Return the Revision object for a named revision"""
346
323
                                    than normal. I.e. during 'upgrade'.
347
324
        """
348
325
        if not _found:
349
 
            format = RepositoryFormat.find_format(a_bzrdir)
 
326
            format = RepositoryFormatMetaDir.find_format(a_bzrdir)
350
327
        if _override_transport is not None:
351
328
            repo_transport = _override_transport
352
329
        else:
392
369
    def __ne__(self, other):
393
370
        return self.__class__ is not other.__class__
394
371
 
395
 
    def get_format_string(self):
 
372
    @classmethod
 
373
    def get_format_string(cls):
396
374
        """See RepositoryFormat.get_format_string()."""
397
375
        return "Bazaar-NG Knit Repository Format 1"
398
376
 
434
412
 
435
413
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
436
414
 
437
 
    def get_format_string(self):
 
415
    @classmethod
 
416
    def get_format_string(cls):
438
417
        """See RepositoryFormat.get_format_string()."""
439
418
        return "Bazaar Knit Repository Format 3 (bzr 0.15)\n"
440
419
 
475
454
 
476
455
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
477
456
 
478
 
    def get_format_string(self):
 
457
    @classmethod
 
458
    def get_format_string(cls):
479
459
        """See RepositoryFormat.get_format_string()."""
480
460
        return 'Bazaar Knit Repository Format 4 (bzr 1.0)\n'
481
461