~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Martin Pool
  • Date: 2005-09-22 06:59:59 UTC
  • Revision ID: mbp@sourcefrog.net-20050922065959-907f0d91d56d68d7
- raise NotBranchError if format file can't be read

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
import sys
19
19
import os
 
20
import errno
20
21
from cStringIO import StringIO
21
22
 
22
23
import bzrlib
345
346
        In the future, we might need different in-memory Branch
346
347
        classes to support downlevel branches.  But not yet.
347
348
        """
348
 
        fmt = self.controlfile('branch-format', 'r').read()
 
349
        try:
 
350
            fmt = self.controlfile('branch-format', 'r').read()
 
351
        except IOError, e:
 
352
            if e.errno == errno.ENOENT:
 
353
                raise NotBranchError(self.base)
 
354
            else:
 
355
                raise
 
356
 
349
357
        if fmt == BZR_BRANCH_FORMAT_5:
350
358
            self._branch_format = 5
351
359
        elif fmt == BZR_BRANCH_FORMAT_4: