comparison src/org/tmatesoft/hg/util/FileWalker.java @ 461:613c883e360e

Do not walk into nested repositories at all, ignore not only .hg but whole nested repo
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 20 Jun 2012 16:51:18 +0200
parents 48f993aa2f41
children bd5926e24aa3
comparison
equal deleted inserted replaced
460:5311e041d2dd 461:613c883e360e
128 Path path = pathHelper.path(isDir ? ensureTrailingSlash(f.getPath()) : f.getPath()); 128 Path path = pathHelper.path(isDir ? ensureTrailingSlash(f.getPath()) : f.getPath());
129 if (!inScope(path)) { 129 if (!inScope(path)) {
130 continue; 130 continue;
131 } 131 }
132 if (isDir) { 132 if (isDir) {
133 if (!".hg/".equals(path.toString())) { 133 // do not dive into <repo>/.hg and
134 // if there's .hg/ under f/, it's a nested repository, which shall not be walked into
135 if (".hg".equals(f.getName()) || new File(f, ".hg").isDirectory()) {
136 continue;
137 } else {
134 dirQueue.addLast(f); 138 dirQueue.addLast(f);
135 } 139 }
136 } else { 140 } else {
137 fileQueue.addLast(f); 141 fileQueue.addLast(f);
138 } 142 }