~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzrtools.py

  • Committer: Aaron Bentley
  • Date: 2006-03-25 05:37:45 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20060325053745-6b17a7909866abcb
Fixed robustness issues in branches command

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
import bzrlib.errors
28
28
from bzrlib.errors import (BzrCommandError, NotBranchError, NoSuchFile,
29
29
                           UnsupportedFormatError, TransportError, 
30
 
                           NoWorkingTree)
 
30
                           NoWorkingTree, PermissionDenied)
31
31
from bzrlib.bzrdir import BzrDir, BzrDirFormat
32
32
 
33
33
def temp_tree():
343
343
            except (NotBranchError, UnsupportedFormatError):
344
344
                continue
345
345
 
 
346
 
346
347
def iter_bzrdirs(t, lister=None):
347
348
    if lister is None:
348
349
        def lister(t):
350
351
    try:
351
352
        bzrdir = bzrdir_from_transport(t)
352
353
        yield bzrdir
353
 
    except (NotBranchError, UnsupportedFormatError, TransportError):
 
354
    except (NotBranchError, UnsupportedFormatError, TransportError,
 
355
            PermissionDenied):
354
356
        pass
355
357
    try:
356
358
        for directory in lister(t):
357
359
            if directory == ".bzr":
358
360
                continue
359
 
            subt = t.clone(directory)
 
361
            try:
 
362
                subt = t.clone(directory)
 
363
            except UnicodeDecodeError:
 
364
                continue
360
365
            for bzrdir in iter_bzrdirs(subt):
361
366
                yield bzrdir
362
 
    except NoSuchFile:
363
 
        pass
364
 
    except TransportError, e:
 
367
    except (NoSuchFile, PermissionDenied, TransportError):
365
368
        pass
366
369
 
367
370