~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Vincent Ladeuil
  • Date: 2011-11-17 17:16:09 UTC
  • mfrom: (6272 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6273.
  • Revision ID: v.ladeuil+lp@free.fr-20111117171609-pzs107pdm0vndlf9
merge trunk to resolve conflicts on news

Show diffs side-by-side

added added

removed removed

Lines of Context:
1606
1606
        """Return the format for the branch object in controldir."""
1607
1607
        try:
1608
1608
            transport = controldir.get_branch_transport(None, name=name)
 
1609
        except errors.NoSuchFile:
 
1610
            raise errors.NotBranchError(path=name, bzrdir=controldir)
 
1611
        try:
1609
1612
            format_string = transport.get_bytes("format")
1610
1613
            return format_registry.get(format_string)
1611
1614
        except errors.NoSuchFile:
3030
3033
            except errors.RevisionNotPresent, e:
3031
3034
                raise errors.GhostRevisionsHaveNoRevno(revision_id, e.revision_id)
3032
3035
            index = len(self._partial_revision_history_cache) - 1
 
3036
            if index < 0:
 
3037
                raise errors.NoSuchRevision(self, revision_id)
3033
3038
            if self._partial_revision_history_cache[index] != revision_id:
3034
3039
                raise errors.NoSuchRevision(self, revision_id)
3035
3040
        return self.revno() - index