/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/transactions.py

  • Committer: Robert Collins
  • Date: 2007-09-19 05:14:14 UTC
  • mto: (2835.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 2836.
  • Revision ID: robertc@robertcollins.net-20070919051414-2tgjqteg7k3ps4h0
* ``pull``, ``merge`` and ``push`` will no longer silently correct some
  repository index errors that occured as a result of the Weave disk format.
  Instead the ``reconcile`` command needs to be run to correct those
  problems if they exist (and it has been able to fix most such problems
  since bzr 0.8). Some new problems have been identified during this release
  and you should run ``bzr check`` once on every repository to see if you
  need to reconcile. If you cannot ``pull`` or ``merge`` from a remote
  repository due to mismatched parent errors - a symptom of index errors -
  you should simply take a full copy of that remote repository to a clean
  directory outside any local repositories, then run reconcile on it, and
  finally pull from it locally. (And naturally email the repositories owner
  to ask them to upgrade and run reconcile).
  (Robert Collins)

* ``VersionedFile.fix_parents`` has been removed as a harmful API.
  ``VersionedFile.join`` will no longer accept different parents on either
  side of a join - it will either ignore them, or error, depending on the
  implementation. See notes when upgrading for more information.
  (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program; if not, write to the Free Software
16
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
18
"""This module provides a transactional facility.
19
19
 
30
30
write ordering approach we use for consistency 'dirty' is a misleading term.
31
31
A dirty object is one we have modified.
32
32
 
33
 
Both read and write transactions *may* flush unchanged objects out of
34
 
memory, unless they are marked as 'precious' which indicates that
 
33
Both read and write transactions *may* flush unchanged objects out of 
 
34
memory, unless they are marked as 'precious' which indicates that 
35
35
repeated reads cannot be obtained if the object is ejected, or that
36
36
the object is an expensive one for obtaining.
37
37
"""
63
63
 
64
64
    def register_clean(self, an_object, precious=False):
65
65
        """Register an_object as being clean.
66
 
 
 
66
        
67
67
        If the precious hint is True, the object will not
68
68
        be ejected from the object identity map ever.
69
69
        """
79
79
 
80
80
    def set_cache_size(self, size):
81
81
        """Set a new cache size."""
82
 
        if size < -1:
83
 
            raise ValueError(size)
 
82
        assert -1 <= size
84
83
        self._limit = size
85
84
        self._trim()
86
85
 
139
138
 
140
139
    def register_dirty(self, an_object):
141
140
        """Register an_object as being dirty.
142
 
 
 
141
        
143
142
        Dirty objects are not ejected from the identity map
144
143
        until the transaction finishes and get informed
145
144
        when the transaction finishes.
154
153
        """Write transactions allow writes."""
155
154
        return True
156
155
 
157
 
 
 
156
        
158
157
class PassThroughTransaction(object):
159
158
    """A pass through transaction
160
 
 
 
159
    
161
160
    - nothing is cached.
162
161
    - nothing ever gets into the identity map.
163
162
    """
176
175
 
177
176
    def register_clean(self, an_object, precious=False):
178
177
        """Register an_object as being clean.
179
 
 
 
178
        
180
179
        Note that precious is only a hint, and PassThroughTransaction
181
180
        ignores it.
182
181
        """
183
182
 
184
183
    def register_dirty(self, an_object):
185
184
        """Register an_object as being dirty.
186
 
 
 
185
        
187
186
        Dirty objects get informed
188
187
        when the transaction finishes.
189
188
        """