~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: 2007-10-04 21:50:01 UTC
  • mfrom: (2881.3.1 branch)
  • Revision ID: pqm@pqm.ubuntu.com-20071004215001-549ul8av89cwpnjp
(robertc) Add -Devil information on some Branch methods, plus comment and docstring corrections. (Robert Collins)

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:
1364
1367
    @needs_write_lock
1365
1368
    def set_revision_history(self, rev_history):
1366
1369
        """See Branch.set_revision_history."""
 
1370
        if 'evil' in debug.debug_flags:
 
1371
            mutter_callsite(3, "set_revision_history scales with history.")
1367
1372
        rev_history = [osutils.safe_revision_id(r) for r in rev_history]
1368
1373
        self._clear_cached_state()
1369
1374
        self._write_revision_history(rev_history)
1397
1402
 
1398
1403
    def _lefthand_history(self, revision_id, last_rev=None,
1399
1404
                          other_branch=None):
 
1405
        if 'evil' in debug.debug_flags:
 
1406
            mutter_callsite(4, "_lefthand_history scales with history.")
1400
1407
        # stop_revision must be a descendant of last_revision
1401
1408
        stop_graph = self.repository.get_revision_graph(revision_id)
1402
1409
        if (last_rev is not None and last_rev != _mod_revision.NULL_REVISION
1446
1453
            # whats the current last revision, before we fetch [and change it
1447
1454
            # possibly]
1448
1455
            last_rev = _mod_revision.ensure_null(self.last_revision())
1449
 
            # we fetch here regardless of whether we need to so that we pickup
1450
 
            # filled in ghosts.
 
1456
            # we fetch here so that we don't process data twice in the common
 
1457
            # case of having something to pull, and so that the check for 
 
1458
            # already merged can operate on the just fetched graph, which will
 
1459
            # be cached in memory.
1451
1460
            self.fetch(other, stop_revision)
1452
1461
            if self.repository.get_graph().is_ancestor(stop_revision,
1453
1462
                                                       last_rev):