diff --git a/py/impl/path/svnwc.py b/py/impl/path/svnwc.py index 380c6d269..4929bb828 100644 --- a/py/impl/path/svnwc.py +++ b/py/impl/path/svnwc.py @@ -808,9 +808,11 @@ recursively. """ def notsvn(path): return path.basename != '.svn' - paths = [self.__class__(p, auth=self.auth) - for p in self.localpath.listdir() - if notsvn(p) and (not fil or fil(p))] + paths = [] + for localpath in self.localpath.listdir(notsvn): + p = self.__class__(localpath, auth=self.auth) + if notsvn(p) and (not fil or fil(p)): + paths.append(p) self._sortlist(paths, sort) return paths diff --git a/testing/path/test_svnwc.py b/testing/path/test_svnwc.py index b036ce604..c9679cfad 100644 --- a/testing/path/test_svnwc.py +++ b/testing/path/test_svnwc.py @@ -276,6 +276,13 @@ class TestWCSvnCommandPath(CommonSvnTests): finally: notexisting.remove() + def test_listdir_versioned(self, path1): + assert path1.check(versioned=1) + p = path1.localpath.ensure("not_a_versioned_file") + l = [x.localpath + for x in path1.listdir(lambda x: x.check(versioned=True))] + assert p not in l + def test_nonversioned_remove(self, path1): assert path1.check(versioned=1) somefile = path1.join('nonversioned/somefile')