~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Martin Pool
  • Date: 2007-09-25 08:14:12 UTC
  • mto: This revision was merged to the branch mainline in revision 2895.
  • Revision ID: mbp@sourcefrog.net-20070925081412-ta60zj5qxfuokev3
Remove most calls to safe_file_id and safe_revision_id.

The deprecation period for passing unicode objects as revision ids is now over.

Show diffs side-by-side

added added

removed removed

Lines of Context:
488
488
        """Given a revision id, return its revno"""
489
489
        if _mod_revision.is_null(revision_id):
490
490
            return 0
491
 
        revision_id = osutils.safe_revision_id(revision_id)
492
491
        history = self.revision_history()
493
492
        try:
494
493
            return history.index(revision_id) + 1
686
685
            new_history = []
687
686
        new_history = self.revision_history()
688
687
        if revision_id is not None and new_history != []:
689
 
            revision_id = osutils.safe_revision_id(revision_id)
690
688
            try:
691
689
                new_history = new_history[:new_history.index(revision_id) + 1]
692
690
            except ValueError:
1363
1361
    @needs_write_lock
1364
1362
    def set_revision_history(self, rev_history):
1365
1363
        """See Branch.set_revision_history."""
1366
 
        rev_history = [osutils.safe_revision_id(r) for r in rev_history]
1367
1364
        self._clear_cached_state()
1368
1365
        self._write_revision_history(rev_history)
1369
1366
        self._cache_revision_history(rev_history)
1382
1379
        configured to check constraints on history, in which case this may not
1383
1380
        be permitted.
1384
1381
        """
1385
 
        revision_id = osutils.safe_revision_id(revision_id)
1386
1382
        history = self._lefthand_history(revision_id)
1387
1383
        assert len(history) == revno, '%d != %d' % (len(history), revno)
1388
1384
        self.set_revision_history(history)
1426
1422
        :param other_branch: The other branch that DivergedBranches should
1427
1423
            raise with respect to.
1428
1424
        """
1429
 
        revision_id = osutils.safe_revision_id(revision_id)
1430
1425
        self.set_revision_history(self._lefthand_history(revision_id,
1431
1426
            last_rev, other_branch))
1432
1427
 
1440
1435
                if stop_revision is None:
1441
1436
                    # if there are no commits, we're done.
1442
1437
                    return
1443
 
            else:
1444
 
                stop_revision = osutils.safe_revision_id(stop_revision)
1445
1438
            # whats the current last revision, before we fetch [and change it
1446
1439
            # possibly]
1447
1440
            last_rev = _mod_revision.ensure_null(self.last_revision())
1930
1923
 
1931
1924
    @needs_write_lock
1932
1925
    def set_last_revision_info(self, revno, revision_id):
1933
 
        revision_id = osutils.safe_revision_id(revision_id)
1934
1926
        if self._get_append_revisions_only():
1935
1927
            self._check_history_violation(revision_id)
1936
1928
        self._write_last_revision_info(revno, revision_id)