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

  • Committer: Martin Pool
  • Date: 2007-10-08 07:29:57 UTC
  • mfrom: (2894 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2895.
  • Revision ID: mbp@sourcefrog.net-20071008072957-uhm1gl1mqcsdc377
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
        bzrdir,
27
27
        cache_utf8,
28
28
        config as _mod_config,
 
29
        debug,
29
30
        errors,
30
31
        lockdir,
31
32
        lockable_files,
61
62
                                      zero_eight, zero_nine, zero_sixteen,
62
63
                                      zero_ninetyone,
63
64
                                      )
64
 
from bzrlib.trace import mutter, note
 
65
from bzrlib.trace import mutter, mutter_callsite, note
65
66
 
66
67
 
67
68
BZR_BRANCH_FORMAT_4 = "Bazaar-NG branch, format 0.0.4\n"
404
405
 
405
406
    @needs_read_lock
406
407
    def revision_history(self):
407
 
        """Return sequence of revision hashes on to this branch.
 
408
        """Return sequence of revision ids on this branch.
408
409
        
409
410
        This method will cache the revision history for as long as it is safe to
410
411
        do so.
411
412
        """
 
413
        if 'evil' in debug.debug_flags:
 
414
            mutter_callsite(3, "revision_history scales with history.")
412
415
        if self._revision_history_cache is not None:
413
416
            history = self._revision_history_cache
414
417
        else:
504
507
            raise errors.NoSuchRevision(self, revno)
505
508
        return history[revno - 1]
506
509
 
507
 
    def pull(self, source, overwrite=False, stop_revision=None):
 
510
    def pull(self, source, overwrite=False, stop_revision=None,
 
511
             possible_transports=None):
508
512
        """Mirror source into this branch.
509
513
 
510
514
        This branch is considered to be 'local', having low latency.
1361
1365
    @needs_write_lock
1362
1366
    def set_revision_history(self, rev_history):
1363
1367
        """See Branch.set_revision_history."""
 
1368
        if 'evil' in debug.debug_flags:
 
1369
            mutter_callsite(3, "set_revision_history scales with history.")
1364
1370
        self._clear_cached_state()
1365
1371
        self._write_revision_history(rev_history)
1366
1372
        self._cache_revision_history(rev_history)
1392
1398
 
1393
1399
    def _lefthand_history(self, revision_id, last_rev=None,
1394
1400
                          other_branch=None):
 
1401
        if 'evil' in debug.debug_flags:
 
1402
            mutter_callsite(4, "_lefthand_history scales with history.")
1395
1403
        # stop_revision must be a descendant of last_revision
1396
1404
        stop_graph = self.repository.get_revision_graph(revision_id)
1397
1405
        if (last_rev is not None and last_rev != _mod_revision.NULL_REVISION
1438
1446
            # whats the current last revision, before we fetch [and change it
1439
1447
            # possibly]
1440
1448
            last_rev = _mod_revision.ensure_null(self.last_revision())
1441
 
            # we fetch here regardless of whether we need to so that we pickup
1442
 
            # filled in ghosts.
 
1449
            # we fetch here so that we don't process data twice in the common
 
1450
            # case of having something to pull, and so that the check for 
 
1451
            # already merged can operate on the just fetched graph, which will
 
1452
            # be cached in memory.
1443
1453
            self.fetch(other, stop_revision)
1444
1454
            if self.repository.get_graph().is_ancestor(stop_revision,
1445
1455
                                                       last_rev):
1455
1465
 
1456
1466
    @needs_write_lock
1457
1467
    def pull(self, source, overwrite=False, stop_revision=None,
1458
 
             _hook_master=None, run_hooks=True):
 
1468
             _hook_master=None, run_hooks=True, possible_transports=None):
1459
1469
        """See Branch.pull.
1460
1470
 
1461
1471
        :param _hook_master: Private parameter - set the branch to 
1659
1669
        
1660
1670
    @needs_write_lock
1661
1671
    def pull(self, source, overwrite=False, stop_revision=None,
1662
 
             run_hooks=True):
 
1672
             run_hooks=True, possible_transports=None):
1663
1673
        """Pull from source into self, updating my master if any.
1664
1674
        
1665
1675
        :param run_hooks: Private parameter - if false, this branch
1670
1680
        master_branch = None
1671
1681
        if bound_location and source.base != bound_location:
1672
1682
            # not pulling from master, so we need to update master.
1673
 
            master_branch = self.get_master_branch()
 
1683
            master_branch = self.get_master_branch(possible_transports)
1674
1684
            master_branch.lock_write()
1675
1685
        try:
1676
1686
            if master_branch: