/** * Check if this sub repo is the ancestor of given sub repo. * * @param that * non null * @return true if this sub repo is the ancestor of given sub repo. */ public boolean isAncestorOf(RepoProject that) { return isAncestorOf(that.getPathWithSlash()); }
/** Remove projects that sits in a subdirectory of any other project. */ void removeOverlaps() { Collections.sort(filteredProjects); Iterator<RepoProject> iter = filteredProjects.iterator(); if (!iter.hasNext()) return; RepoProject last = iter.next(); while (iter.hasNext()) { RepoProject p = iter.next(); if (last.isAncestorOf(p)) iter.remove(); else last = p; } removeNestedCopyAndLinkfiles(); }
private boolean isNestedReferencefile(ReferenceFile referencefile) { if (referencefile.dest.indexOf('/') == -1) { // If the referencefile is at root level then it won't be nested. return false; } for (RepoProject proj : filteredProjects) { if (proj.getPath().compareTo(referencefile.dest) > 0) { // Early return as remaining projects can't be ancestor of this // referencefile config (filteredProjects is sorted). return false; } if (proj.isAncestorOf(referencefile.dest)) { return true; } } return false; }
/** * Check if this sub repo is the ancestor of given sub repo. * * @param that * non null * @return true if this sub repo is the ancestor of given sub repo. */ public boolean isAncestorOf(RepoProject that) { return isAncestorOf(that.getPathWithSlash()); }
/** * Check if this sub repo is the ancestor of given sub repo. * * @param that * non null * @return true if this sub repo is the ancestor of given sub repo. */ public boolean isAncestorOf(RepoProject that) { return isAncestorOf(that.getPathWithSlash()); }
/** Remove projects that sits in a subdirectory of any other project. */ void removeOverlaps() { Collections.sort(filteredProjects); Iterator<RepoProject> iter = filteredProjects.iterator(); if (!iter.hasNext()) return; RepoProject last = iter.next(); while (iter.hasNext()) { RepoProject p = iter.next(); if (last.isAncestorOf(p)) iter.remove(); else last = p; } removeNestedCopyfiles(); }
private boolean isNestedCopyfile(CopyFile copyfile) { if (copyfile.dest.indexOf('/') == -1) { // If the copyfile is at root level then it won't be nested. return false; } for (RepoProject proj : filteredProjects) { if (proj.getPath().compareTo(copyfile.dest) > 0) { // Early return as remaining projects can't be ancestor of this // copyfile config (filteredProjects is sorted). return false; } if (proj.isAncestorOf(copyfile.dest)) { return true; } } return false; }
/** Remove projects that sits in a subdirectory of any other project. */ void removeOverlaps() { Collections.sort(filteredProjects); Iterator<RepoProject> iter = filteredProjects.iterator(); if (!iter.hasNext()) return; RepoProject last = iter.next(); while (iter.hasNext()) { RepoProject p = iter.next(); if (last.isAncestorOf(p)) iter.remove(); else last = p; } removeNestedCopyAndLinkfiles(); }
private boolean isNestedReferencefile(ReferenceFile referencefile) { if (referencefile.dest.indexOf('/') == -1) { // If the referencefile is at root level then it won't be nested. return false; } for (RepoProject proj : filteredProjects) { if (proj.getPath().compareTo(referencefile.dest) > 0) { // Early return as remaining projects can't be ancestor of this // referencefile config (filteredProjects is sorted). return false; } if (proj.isAncestorOf(referencefile.dest)) { return true; } } return false; }