~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-12-02 14:58:47 UTC
  • mfrom: (5554.1.3 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20101202145847-fw822sd3nyhvrwmi
(vila) Merge 2.2 into trunk including fix for bug #583667 and bug
        #681885 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
        self._revision_id_to_revno_cache = None
93
93
        self._partial_revision_id_to_revno_cache = {}
94
94
        self._partial_revision_history_cache = []
 
95
        self._tags_bytes = None
95
96
        self._last_revision_info_cache = None
96
97
        self._merge_sorted_revisions_cache = None
97
98
        self._open_hook()
227
228
            possible_transports=[self.bzrdir.root_transport])
228
229
        return a_branch.repository
229
230
 
 
231
    @needs_read_lock
230
232
    def _get_tags_bytes(self):
231
233
        """Get the bytes of a serialised tags dict.
232
234
 
239
241
        :return: The bytes of the tags file.
240
242
        :seealso: Branch._set_tags_bytes.
241
243
        """
242
 
        return self._transport.get_bytes('tags')
 
244
        if self._tags_bytes is None:
 
245
            self._tags_bytes = self._transport.get_bytes('tags')
 
246
        return self._tags_bytes
243
247
 
244
248
    def _get_nick(self, local=False, possible_transports=None):
245
249
        config = self.get_config()
876
880
 
877
881
        :seealso: Branch._get_tags_bytes.
878
882
        """
879
 
        return _run_with_write_locked_target(self, self._transport.put_bytes,
880
 
            'tags', bytes)
 
883
        return _run_with_write_locked_target(self, self._set_tags_bytes_locked,
 
884
                bytes)
 
885
 
 
886
    def _set_tags_bytes_locked(self, bytes):
 
887
        self._tags_bytes = bytes
 
888
        return self._transport.put_bytes('tags', bytes)
881
889
 
882
890
    def _cache_revision_history(self, rev_history):
883
891
        """Set the cached revision history to rev_history.
913
921
        self._merge_sorted_revisions_cache = None
914
922
        self._partial_revision_history_cache = []
915
923
        self._partial_revision_id_to_revno_cache = {}
 
924
        self._tags_bytes = None
916
925
 
917
926
    def _gen_revision_history(self):
918
927
        """Return sequence of revision hashes on to this branch.
3346
3355
        if isinstance(format, remote.RemoteBranchFormat):
3347
3356
            format._ensure_real()
3348
3357
            return format._custom_format
3349
 
        return format                                                                                                  
 
3358
        return format
3350
3359
 
3351
3360
    @needs_write_lock
3352
3361
    def copy_content_into(self, revision_id=None):