protected void startElement(DAVElement parent, DAVElement element, Attributes attrs) { char type = 0; String copyPath = null; long copyRevision = -1; if (element == ADDED_PATH || element == REPLACED_PATH) { type = element == ADDED_PATH ? SVNLogEntryPath.TYPE_ADDED : SVNLogEntryPath.TYPE_REPLACED; copyPath = attrs.getValue("copyfrom-path"); String copyRevisionStr = attrs.getValue("copyfrom-rev"); if (copyPath != null && copyRevisionStr != null) { try { copyRevision = Long.parseLong(copyRevisionStr); } catch (NumberFormatException e) { } } } else if (element == MODIFIED_PATH) { type = SVNLogEntryPath.TYPE_MODIFIED; } else if (element == DELETED_PATH) { type = SVNLogEntryPath.TYPE_DELETED; } if (type != 0) { myPath = new SVNLogEntryPath(null, type, copyPath, copyRevision); } }
private SVNLogEntryPath getFileCopyOrigin(String path) throws SVNException { Object[] paths = myCopiedPaths.keySet().toArray(); Arrays.sort(paths, 0, paths.length, SVNPathUtil.PATH_COMPARATOR); SVNLogEntryPath realPath = null; List candidates = new ArrayList(); for (int i = 0; i < paths.length; i++) { String copiedPath = (String) paths[i]; if (!path.startsWith(copiedPath + "/")) { continue; } else if (path.equals(copiedPath)) { return (SVNLogEntryPath) myCopiedPaths.get(copiedPath); } candidates.add(copiedPath); } // check candidates from the end of the list for(int i = candidates.size() - 1; i >=0; i--) { String candidateParent = (String) candidates.get(i); if (getSourceRepository().checkPath(candidateParent, myTargetRevision) != SVNNodeKind.DIR) { continue; } SVNLogEntryPath changedPath = (SVNLogEntryPath) myCopiedPaths.get(candidateParent); String fileRelativePath = path.substring(candidateParent.length() + 1); fileRelativePath = SVNPathUtil.append(changedPath.getCopyPath(), fileRelativePath); return new SVNLogEntryPath(path, ' ', fileRelativePath, changedPath.getCopyRevision()); } return realPath; }
private SVNLogEntryPath getFileCopyOrigin(String path) throws SVNException { Object[] paths = myCopiedPaths.keySet().toArray(); Arrays.sort(paths, 0, paths.length, SVNPathUtil.PATH_COMPARATOR); SVNLogEntryPath realPath = null; List candidates = new ArrayList(); for (int i = 0; i < paths.length; i++) { String copiedPath = (String) paths[i]; if (!path.startsWith(copiedPath + "/")) { continue; } else if (path.equals(copiedPath)) { return (SVNLogEntryPath) myCopiedPaths.get(copiedPath); } candidates.add(copiedPath); } // check candidates from the end of the list for(int i = candidates.size() - 1; i >=0; i--) { String candidateParent = (String) candidates.get(i); if (getSourceRepository().checkPath(candidateParent, myTargetRevision) != SVNNodeKind.DIR) { continue; } SVNLogEntryPath changedPath = (SVNLogEntryPath) myCopiedPaths.get(candidateParent); String fileRelativePath = path.substring(candidateParent.length() + 1); fileRelativePath = SVNPathUtil.append(changedPath.getCopyPath(), fileRelativePath); return new SVNLogEntryPath(path, ' ', fileRelativePath, changedPath.getCopyRevision()); } return realPath; }
private SVNLogEntryPath getFileCopyOrigin(String path) throws SVNException { String[] paths = (String[]) myCopiedPaths.keySet().toArray(new String[myCopiedPaths.size()]); Arrays.sort(paths, 0, paths.length, SVNPathUtil.PATH_COMPARATOR); SVNLogEntryPath realPath = null; List candidates = new ArrayList(); for (int i = 0; i < paths.length; i++) { String copiedPath = (String) paths[i]; if (!path.startsWith(copiedPath + "/")) { continue; } else if (path.equals(copiedPath)) { return (SVNLogEntryPath) myCopiedPaths.get(copiedPath); } candidates.add(copiedPath); } // check candidates from the end of the list for(int i = candidates.size() - 1; i >=0; i--) { String candidateParent = (String) candidates.get(i); if (getSourceRepository().checkPath(candidateParent, myTargetRevision) != SVNNodeKind.DIR) { continue; } SVNLogEntryPath changedPath = (SVNLogEntryPath) myCopiedPaths.get(candidateParent); String fileRelativePath = path.substring(candidateParent.length() + 1); fileRelativePath = SVNPathUtil.append(changedPath.getCopyPath(), fileRelativePath); return new SVNLogEntryPath(path, ' ', fileRelativePath, changedPath.getCopyRevision()); } return realPath; }
private SVNLogEntryPath getFileCopyOrigin(String path) throws SVNException { Object[] paths = myCopiedPaths.keySet().toArray(); Arrays.sort(paths, 0, paths.length, SVNPathUtil.PATH_COMPARATOR); SVNLogEntryPath realPath = null; List candidates = new ArrayList(); for (int i = 0; i < paths.length; i++) { String copiedPath = (String) paths[i]; if (!path.startsWith(copiedPath + "/")) { continue; } else if (path.equals(copiedPath)) { return (SVNLogEntryPath) myCopiedPaths.get(copiedPath); } candidates.add(copiedPath); } // check candidates from the end of the list for(int i = candidates.size() - 1; i >=0; i--) { String candidateParent = (String) candidates.get(i); if (getSourceRepository().checkPath(candidateParent, myTargetRevision) != SVNNodeKind.DIR) { continue; } SVNLogEntryPath changedPath = (SVNLogEntryPath) myCopiedPaths.get(candidateParent); String fileRelativePath = path.substring(candidateParent.length() + 1); fileRelativePath = SVNPathUtil.append(changedPath.getCopyPath(), fileRelativePath); return new SVNLogEntryPath(path, ' ', fileRelativePath, changedPath.getCopyRevision()); } return realPath; }
nodeKind = SVNNodeKind.parseKind(nodeKindStr); myPath = new SVNLogEntryPath(null, type, copyPath, copyRevision, nodeKind);
nodeKind = SVNNodeKind.parseKind(nodeKindStr); myPath = new SVNLogEntryPath(null, type, copyPath, copyRevision, nodeKind);
nodeKind = SVNNodeKind.parseKind(nodeKindStr); myPath = new SVNLogEntryPath(null, type, copyPath, copyRevision, nodeKind);
long copyRevision = SVNReader.getLong(pathItems, 3); String kind = SVNReader.getString(pathItems, 4); changedPathsMap.put(path, new SVNLogEntryPath(path, action.charAt(0), copyPath, copyRevision, kind != null ? SVNNodeKind.parseKind(kind) : SVNNodeKind.UNKNOWN));
String copyPath = SVNReader.getString(buffer, 2); long copyRev = SVNReader.getLong(buffer, 3); changedPathsMap.put(path, new SVNLogEntryPath(path, type.charAt(0), copyPath, copyRev));
long copyRevision = SVNReader.getLong(pathItems, 3); String kind = SVNReader.getString(pathItems, 4); changedPathsMap.put(path, new SVNLogEntryPath(path, action.charAt(0), copyPath, copyRevision, kind != null ? SVNNodeKind.parseKind(kind) : SVNNodeKind.UNKNOWN));
long copyRevision = SVNReader.getLong(pathItems, 3); String kind = SVNReader.getString(pathItems, 4); changedPathsMap.put(path, new SVNLogEntryPath(path, action.charAt(0), copyPath, copyRevision, kind != null ? SVNNodeKind.parseKind(kind) : SVNNodeKind.UNKNOWN));
@Issue("JENKINS-18099") @Test public void globalExclusionRevprop() throws Exception { SubversionSCM scm = new SubversionSCM( Arrays.asList(new SubversionSCM.ModuleLocation("file://some/repo", ".")), new UpdateUpdater(), null, null, null, null, null, null, false); scm.getDescriptor().setGlobalExcludedRevprop("ignoreme"); SVNProperties p = new SVNProperties(); p.put("ignoreme", "*"); Map<String, SVNLogEntryPath> paths = new HashMap<>(); paths.put("/foo", new SVNLogEntryPath("/foo", SVNLogEntryPath.TYPE_MODIFIED, null, -1)); SVNLogEntry e = new SVNLogEntry(paths, 1234L, p, false); SVNLogFilter filter = scm.createSVNLogFilter(); assertFalse(filter.isIncluded(e)); }