~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Robert Collins
  • Date: 2007-10-11 04:54:04 UTC
  • mfrom: (2904 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2933.
  • Revision ID: robertc@robertcollins.net-20071011045404-lj5a81n4ripi01mt
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
491
491
        """Given a revision id, return its revno"""
492
492
        if _mod_revision.is_null(revision_id):
493
493
            return 0
494
 
        revision_id = osutils.safe_revision_id(revision_id)
495
494
        history = self.revision_history()
496
495
        try:
497
496
            return history.index(revision_id) + 1
690
689
            new_history = []
691
690
        new_history = self.revision_history()
692
691
        if revision_id is not None and new_history != []:
693
 
            revision_id = osutils.safe_revision_id(revision_id)
694
692
            try:
695
693
                new_history = new_history[:new_history.index(revision_id) + 1]
696
694
            except ValueError:
1369
1367
        """See Branch.set_revision_history."""
1370
1368
        if 'evil' in debug.debug_flags:
1371
1369
            mutter_callsite(3, "set_revision_history scales with history.")
1372
 
        rev_history = [osutils.safe_revision_id(r) for r in rev_history]
1373
1370
        self._clear_cached_state()
1374
1371
        self._write_revision_history(rev_history)
1375
1372
        self._cache_revision_history(rev_history)
1388
1385
        configured to check constraints on history, in which case this may not
1389
1386
        be permitted.
1390
1387
        """
1391
 
        revision_id = osutils.safe_revision_id(revision_id)
1392
1388
        history = self._lefthand_history(revision_id)
1393
1389
        assert len(history) == revno, '%d != %d' % (len(history), revno)
1394
1390
        self.set_revision_history(history)
1434
1430
        :param other_branch: The other branch that DivergedBranches should
1435
1431
            raise with respect to.
1436
1432
        """
1437
 
        revision_id = osutils.safe_revision_id(revision_id)
1438
1433
        self.set_revision_history(self._lefthand_history(revision_id,
1439
1434
            last_rev, other_branch))
1440
1435
 
1448
1443
                if stop_revision is None:
1449
1444
                    # if there are no commits, we're done.
1450
1445
                    return
1451
 
            else:
1452
 
                stop_revision = osutils.safe_revision_id(stop_revision)
1453
1446
            # whats the current last revision, before we fetch [and change it
1454
1447
            # possibly]
1455
1448
            last_rev = _mod_revision.ensure_null(self.last_revision())
1940
1933
 
1941
1934
    @needs_write_lock
1942
1935
    def set_last_revision_info(self, revno, revision_id):
1943
 
        revision_id = osutils.safe_revision_id(revision_id)
1944
1936
        if self._get_append_revisions_only():
1945
1937
            self._check_history_violation(revision_id)
1946
1938
        self._write_last_revision_info(revno, revision_id)