Ejemplo n.º 1
0
    def walkit(root, reporoot):
        files, dirs = [], []

        try:
            fullpath = join(absroot, root)
            for name, kind in osutil.listdir(fullpath):
                if kind == stat.S_IFDIR:
                    if name == '.hg':
                        if not reporoot:
                            return
                    else:
                        dirs.append(name)
                        path = join(root, name)
                        if dirstate._ignore(path):
                            continue
                        for result in walkit(path, False):
                            yield result
                elif kind in (stat.S_IFREG, stat.S_IFLNK):
                    files.append(name)
            yield fullpath, dirs, files

        except OSError, err:
            if err.errno == errno.ENOTDIR:
                # fullpath was a directory, but has since been replaced
                # by a file.
                yield fullpath, dirs, files
            elif err.errno not in walk_ignored_errors:
                raise
Ejemplo n.º 2
0
    def walkit(root, reporoot):
        files, dirs = [], []

        try:
            fullpath = join(absroot, root)
            for name, kind in osutil.listdir(fullpath):
                if kind == stat.S_IFDIR:
                    if name == '.hg':
                        if not reporoot:
                            return
                    else:
                        dirs.append(name)
                        path = join(root, name)
                        if dirstate._ignore(path):
                            continue
                        for result in walkit(path, False):
                            yield result
                elif kind in (stat.S_IFREG, stat.S_IFLNK):
                    files.append(name)
            yield fullpath, dirs, files

        except OSError, err:
            if err.errno == errno.ENOTDIR:
                # fullpath was a directory, but has since been replaced
                # by a file.
                yield fullpath, dirs, files
            elif err.errno not in walk_ignored_errors:
                raise
Ejemplo n.º 3
0
    def walkit(root, reporoot):
        files, dirs = [], []
        hginside = False

        try:
            fullpath = rootslash + root
            for name, kind in osutil.listdir(fullpath):
                if kind == stat.S_IFDIR:
                    if name == '.hg':
                        hginside = True
                        if reporoot:
                            continue
                        else:
                            break
                    dirs.append(name)
                elif kind in (stat.S_IFREG, stat.S_IFLNK):
                    path = join(root, name)
                    files.append((name, kind))

            yield hginside, fullpath, dirs, files

            for subdir in dirs:
                path = join(root, subdir)
                if repo.dirstate._ignore(path):
                    continue
                for result in walkit(path, False):
                    if not result[0]:
                        yield result
        except OSError, err:
            if err.errno not in walk_ignored_errors:
                raise
Ejemplo n.º 4
0
 def walkit(dirname, top):
     fullpath = server.join(absroot, dirname)
     try:
         for name, kind in osutil.listdir(fullpath):
             if kind == stat.S_IFDIR:
                 if name == '.hg':
                     if not top:
                         return
                 else:
                     d = server.join(dirname, name)
                     if dirstate._ignore(d):
                         continue
                     for subdir in walkit(d, False):
                         yield subdir
     except OSError, err:
         if err.errno not in server.walk_ignored_errors:
             raise
Ejemplo n.º 5
0
 def walkit(dirname, top):
     fullpath = server.join(absroot, dirname)
     try:
         for name, kind in osutil.listdir(fullpath):
             if kind == stat.S_IFDIR:
                 if name == '.hg':
                     if not top:
                         return
                 else:
                     d = server.join(dirname, name)
                     if dirstate._ignore(d):
                         continue
                     for subdir in walkit(d, False):
                         yield subdir
     except OSError, err:
         if err.errno not in server.walk_ignored_errors:
             raise
Ejemplo n.º 6
0
 def walkit(dirname, top):
     hginside = False
     try:
         for name, kind in osutil.listdir(rootslash + dirname):
             if kind == stat.S_IFDIR:
                 if name == '.hg':
                     hginside = True
                     if not top: break
                 else:
                     d = join(dirname, name)
                     if repo.dirstate._ignore(d):
                         continue
                     for subdir, hginsub in walkit(d, False):
                         if not hginsub:
                             yield subdir, False
     except OSError, err:
         if err.errno not in walk_ignored_errors:
             raise
Ejemplo n.º 7
0
    def walkit(root, reporoot):
        files, dirs = [], []

        try:
            fullpath = rootslash + root
            for name, kind in osutil.listdir(fullpath):
                if kind == stat.S_IFDIR:
                    if name == '.hg':
                        if not reporoot:
                            return
                    else:
                        dirs.append(name)
                        path = join(root, name)
                        if repo.dirstate._ignore(path):
                            continue
                        for result in walkit(path, False):
                            yield result
                elif kind in (stat.S_IFREG, stat.S_IFLNK):
                    files.append(name)
            yield fullpath, dirs, files

        except OSError, err:
            if err.errno not in walk_ignored_errors:
                raise