/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: John Arbash Meinel
  • Date: 2008-08-13 16:07:10 UTC
  • mto: (3606.2.4 1.6)
  • mto: This revision was merged to the branch mainline in revision 3625.
  • Revision ID: john@arbash-meinel.com-20080813160710-ns4og8r4y6xcmp0b
Factor out the common exception handling looking for ENOTDIR and use it
for osutils.walkdirs() and tree transform code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
 
import sys
18
17
import os
19
18
import errno
20
19
from stat import S_ISREG, S_IEXEC
637
636
        try:
638
637
            children = os.listdir(self._tree.abspath(path))
639
638
        except OSError, e:
640
 
            # See comments in osutils regarding winerror etc.
641
 
            if ((e.errno not in (errno.ENOENT, errno.ESRCH, errno.ENOTDIR)) and
642
 
                (sys.platform!='win32' or e.errno not in (267, errno.EINVAL))):
 
639
            if not (osutils._is_error_enotdir(e)
 
640
                    or e.errno in (errno.ENOENT, errno.ESRCH)):
643
641
                raise
644
642
            return
645
 
            
 
643
 
646
644
        for child in children:
647
645
            childpath = joinpath(path, child)
648
646
            if self._tree.is_control_filename(childpath):