/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Marius Kruger
  • Date: 2010-07-10 21:28:56 UTC
  • mto: (5384.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5385.
  • Revision ID: marius.kruger@enerweb.co.za-20100710212856-uq4ji3go0u5se7hx
* Update documentation
* add NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
    symbol_versioning,
44
44
    trace,
45
45
    tsort,
46
 
    ui,
47
46
    versionedfile,
48
47
    )
49
48
from bzrlib.bundle import serializer
55
54
from bzrlib import (
56
55
    errors,
57
56
    registry,
 
57
    ui,
58
58
    )
59
59
from bzrlib.decorators import needs_read_lock, needs_write_lock, only_raises
60
60
from bzrlib.inter import InterObject
64
64
    ROOT_ID,
65
65
    entry_factory,
66
66
    )
 
67
from bzrlib.recordcounter import RecordCounter
67
68
from bzrlib.lock import _RelockDebugMixin, LogicalLockResult
68
69
from bzrlib.trace import (
69
70
    log_exception_quietly, note, mutter, mutter_callsite, warning)
288
289
 
289
290
        :param tree: The tree which is being committed.
290
291
        """
291
 
        # NB: if there are no parents then this method is not called, so no
292
 
        # need to guard on parents having length.
 
292
        if len(self.parents) == 0:
 
293
            raise errors.RootMissing()
293
294
        entry = entry_factory['directory'](tree.path2id(''), '',
294
295
            None)
295
296
        entry.revision = self._new_revision_id
1045
1046
                " id and insertion revid (%r, %r)"
1046
1047
                % (inv.revision_id, revision_id))
1047
1048
        if inv.root is None:
1048
 
            raise AssertionError()
 
1049
            raise errors.RootMissing()
1049
1050
        return self._add_inventory_checked(revision_id, inv, parents)
1050
1051
 
1051
1052
    def _add_inventory_checked(self, revision_id, inv, parents):
1722
1723
                "May not fetch while in a write group.")
1723
1724
        # fast path same-url fetch operations
1724
1725
        # TODO: lift out to somewhere common with RemoteRepository
1725
 
        # <https://bugs.edge.launchpad.net/bzr/+bug/401646>
 
1726
        # <https://bugs.launchpad.net/bzr/+bug/401646>
1726
1727
        if (self.has_same_location(source)
1727
1728
            and fetch_spec is None
1728
1729
            and self._has_same_fallbacks(source)):
4283
4284
                is_resume = False
4284
4285
            try:
4285
4286
                # locked_insert_stream performs a commit|suspend.
4286
 
                return self._locked_insert_stream(stream, src_format, is_resume)
 
4287
                return self._locked_insert_stream(stream, src_format,
 
4288
                    is_resume)
4287
4289
            except:
4288
4290
                self.target_repo.abort_write_group(suppress_errors=True)
4289
4291
                raise
4336
4338
                # required if the serializers are different only in terms of
4337
4339
                # the inventory.
4338
4340
                if src_serializer == to_serializer:
4339
 
                    self.target_repo.revisions.insert_record_stream(
4340
 
                        substream)
 
4341
                    self.target_repo.revisions.insert_record_stream(substream)
4341
4342
                else:
4342
4343
                    self._extract_and_insert_revisions(substream,
4343
4344
                        src_serializer)
4451
4452
        """Create a StreamSource streaming from from_repository."""
4452
4453
        self.from_repository = from_repository
4453
4454
        self.to_format = to_format
 
4455
        self._record_counter = RecordCounter()
4454
4456
 
4455
4457
    def delta_on_metadata(self):
4456
4458
        """Return True if delta's are permitted on metadata streams.