~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Robert Collins
  • Date: 2010-05-11 08:44:59 UTC
  • mfrom: (5221 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100511084459-pb0uinna9zs3wu59
Merge trunk - resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    chk_map,
27
27
    config,
28
28
    debug,
29
 
    errors,
30
29
    fetch as _mod_fetch,
31
30
    fifo_cache,
32
31
    generate_ids,
53
52
from bzrlib.testament import Testament
54
53
""")
55
54
 
 
55
from bzrlib import (
 
56
    errors,
 
57
    registry,
 
58
    )
56
59
from bzrlib.decorators import needs_read_lock, needs_write_lock, only_raises
57
60
from bzrlib.inter import InterObject
58
61
from bzrlib.inventory import (
62
65
    entry_factory,
63
66
    )
64
67
from bzrlib.lock import _RelockDebugMixin, LogicalLockResult
65
 
from bzrlib import registry
66
68
from bzrlib.trace import (
67
69
    log_exception_quietly, note, mutter, mutter_callsite, warning)
68
70
 
71
73
_deprecation_warning_done = False
72
74
 
73
75
 
 
76
class IsInWriteGroupError(errors.InternalBzrError):
 
77
 
 
78
    _fmt = "May not refresh_data of repo %(repo)s while in a write group."
 
79
 
 
80
    def __init__(self, repo):
 
81
        errors.InternalBzrError.__init__(self, repo=repo)
 
82
 
 
83
 
74
84
class CommitBuilder(object):
75
85
    """Provides an interface to build up a commit.
76
86
 
1658
1668
        return missing_keys
1659
1669
 
1660
1670
    def refresh_data(self):
1661
 
        """Re-read any data needed to to synchronise with disk.
 
1671
        """Re-read any data needed to synchronise with disk.
1662
1672
 
1663
1673
        This method is intended to be called after another repository instance
1664
1674
        (such as one used by a smart server) has inserted data into the
1665
 
        repository. It may not be called during a write group, but may be
1666
 
        called at any other time.
 
1675
        repository. On all repositories this will work outside of write groups.
 
1676
        Some repository formats (pack and newer for bzrlib native formats)
 
1677
        support refresh_data inside write groups. If called inside a write
 
1678
        group on a repository that does not support refreshing in a write group
 
1679
        IsInWriteGroupError will be raised.
1667
1680
        """
1668
 
        if self.is_in_write_group():
1669
 
            raise errors.InternalBzrError(
1670
 
                "May not refresh_data while in a write group.")
1671
1681
        self._refresh_data()
1672
1682
 
1673
1683
    def resume_write_group(self, tokens):