~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

Merge bzr.dev to resolve news conflict

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.
1372
1381
        return format
1373
1382
 
1374
1383
    def create_clone_on_transport(self, to_transport, revision_id=None,
1375
 
        stacked_on=None, create_prefix=False, use_existing_dir=False):
 
1384
        stacked_on=None, create_prefix=False, use_existing_dir=False,
 
1385
        no_tree=None):
1376
1386
        """Create a clone of this branch and its bzrdir.
1377
1387
 
1378
1388
        :param to_transport: The transport to clone onto.
1391
1401
            revision_id = self.last_revision()
1392
1402
        dir_to = self.bzrdir.clone_on_transport(to_transport,
1393
1403
            revision_id=revision_id, stacked_on=stacked_on,
1394
 
            create_prefix=create_prefix, use_existing_dir=use_existing_dir)
 
1404
            create_prefix=create_prefix, use_existing_dir=use_existing_dir,
 
1405
            no_tree=no_tree)
1395
1406
        return dir_to.open_branch()
1396
1407
 
1397
1408
    def create_checkout(self, to_location, revision_id=None,
1522
1533
     * an open routine.
1523
1534
 
1524
1535
    Formats are placed in an dict by their format string for reference
1525
 
    during branch opening. Its not required that these be instances, they
 
1536
    during branch opening. It's not required that these be instances, they
1526
1537
    can be classes themselves with class methods - it simply depends on
1527
1538
    whether state is needed for a given format or not.
1528
1539
 
1819
1830
            "with a bzrlib.branch.PullResult object and only runs in the "
1820
1831
            "bzr client.", (0, 15), None))
1821
1832
        self.create_hook(HookPoint('pre_commit',
1822
 
            "Called after a commit is calculated but before it is is "
 
1833
            "Called after a commit is calculated but before it is "
1823
1834
            "completed. pre_commit is called with (local, master, old_revno, "
1824
1835
            "old_revid, future_revno, future_revid, tree_delta, future_tree"
1825
1836
            "). old_revid is NULL_REVISION for the first commit to a branch, "
3480
3491
                # push into the master from the source branch.
3481
3492
                self.source._basic_push(master_branch, overwrite, stop_revision)
3482
3493
                # and push into the target branch from the source. Note that we
3483
 
                # push from the source branch again, because its considered the
 
3494
                # push from the source branch again, because it's considered the
3484
3495
                # highest bandwidth repository.
3485
3496
                result = self.source._basic_push(self.target, overwrite,
3486
3497
                    stop_revision)