~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Aaron Bentley
  • Date: 2010-05-10 11:34:20 UTC
  • mfrom: (5218 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5221.
  • Revision ID: aaron@aaronbentley.com-20100510113420-toh2d5yioobb5uq1
Merged bzr.dev into transform-commit-full.

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,
62
61
    entry_factory,
63
62
    )
64
63
from bzrlib.lock import _RelockDebugMixin
65
 
from bzrlib import registry
 
64
from bzrlib import (
 
65
    errors,
 
66
    registry,
 
67
    )
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
 
1634
1644
        return missing_keys
1635
1645
 
1636
1646
    def refresh_data(self):
1637
 
        """Re-read any data needed to to synchronise with disk.
 
1647
        """Re-read any data needed to synchronise with disk.
1638
1648
 
1639
1649
        This method is intended to be called after another repository instance
1640
1650
        (such as one used by a smart server) has inserted data into the
1641
 
        repository. It may not be called during a write group, but may be
1642
 
        called at any other time.
 
1651
        repository. On all repositories this will work outside of write groups.
 
1652
        Some repository formats (pack and newer for bzrlib native formats)
 
1653
        support refresh_data inside write groups. If called inside a write
 
1654
        group on a repository that does not support refreshing in a write group
 
1655
        IsInWriteGroupError will be raised.
1643
1656
        """
1644
 
        if self.is_in_write_group():
1645
 
            raise errors.InternalBzrError(
1646
 
                "May not refresh_data while in a write group.")
1647
1657
        self._refresh_data()
1648
1658
 
1649
1659
    def resume_write_group(self, tokens):