private void rejoinModifies(ProgressMonitor pm) throws CancelledException { HashMap<String, DiffEntry> nameMap = new HashMap<>(); ArrayList<DiffEntry> newAdded = new ArrayList<>(added.size()); pm.beginTask(JGitText.get().renamesRejoiningModifies, added.size() + deleted.size()); for (DiffEntry src : deleted) { nameMap.put(src.oldPath, src); advanceOrCancel(pm); } for (DiffEntry dst : added) { DiffEntry src = nameMap.remove(dst.newPath); if (src != null) { if (sameType(src.oldMode, dst.newMode)) { entries.add(DiffEntry.pair(ChangeType.MODIFY, src, dst, src.score)); } else { nameMap.put(src.oldPath, src); newAdded.add(dst); } } else { newAdded.add(dst); } advanceOrCancel(pm); } added = newAdded; deleted = new ArrayList<>(nameMap.values()); }
if (sameType(entry.getOldMode(), entry.getNewMode())) { entries.add(entry); } else {
if (!RenameDetector.sameType(srcEnt.oldMode, dstEnt.newMode)) { pm.update(1); continue;
/** * Find the best match by file path for a given DiffEntry from a list of * DiffEntrys. The returned DiffEntry will be of the same type as <src>. If * no DiffEntry can be found that has the same type, this method will return * null. * * @param src * the DiffEntry to try to find a match for * @param list * a list of DiffEntrys to search through * @return the DiffEntry from <list> who's file path best matches <src> */ private static DiffEntry bestPathMatch(DiffEntry src, List<DiffEntry> list) { DiffEntry best = null; int score = -1; for (DiffEntry d : list) { if (sameType(mode(d), mode(src))) { int tmp = SimilarityRenameDetector .nameScore(path(d), path(src)); if (tmp > score) { best = d; score = tmp; } } } return best; }
if (RenameDetector.sameType(entry.oldMode, entry.newMode)) r.add(entry); else
private void rejoinModifies(ProgressMonitor pm) throws CancelledException { HashMap<String, DiffEntry> nameMap = new HashMap<>(); ArrayList<DiffEntry> newAdded = new ArrayList<>(added.size()); pm.beginTask(JGitText.get().renamesRejoiningModifies, added.size() + deleted.size()); for (DiffEntry src : deleted) { nameMap.put(src.oldPath, src); advanceOrCancel(pm); } for (DiffEntry dst : added) { DiffEntry src = nameMap.remove(dst.newPath); if (src != null) { if (sameType(src.oldMode, dst.newMode)) { entries.add(DiffEntry.pair(ChangeType.MODIFY, src, dst, src.score)); } else { nameMap.put(src.oldPath, src); newAdded.add(dst); } } else { newAdded.add(dst); } advanceOrCancel(pm); } added = newAdded; deleted = new ArrayList<>(nameMap.values()); }
private void rejoinModifies(ProgressMonitor pm) { HashMap<String, DiffEntry> nameMap = new HashMap<String, DiffEntry>(); ArrayList<DiffEntry> newAdded = new ArrayList<DiffEntry>(added.size()); pm.beginTask(JGitText.get().renamesRejoiningModifies, added.size() + deleted.size()); for (DiffEntry src : deleted) { nameMap.put(src.oldPath, src); pm.update(1); } for (DiffEntry dst : added) { DiffEntry src = nameMap.remove(dst.newPath); if (src != null) { if (sameType(src.oldMode, dst.newMode)) { entries.add(DiffEntry.pair(ChangeType.MODIFY, src, dst, src.score)); } else { nameMap.put(src.oldPath, src); newAdded.add(dst); } } else { newAdded.add(dst); } pm.update(1); } added = newAdded; deleted = new ArrayList<DiffEntry>(nameMap.values()); }
if (sameType(entry.getOldMode(), entry.getNewMode())) { entries.add(entry); } else {
if (sameType(entry.getOldMode(), entry.getNewMode())) { entries.add(entry); } else {
if (!RenameDetector.sameType(srcEnt.oldMode, dstEnt.newMode)) { pm.update(1); continue;
if (!RenameDetector.sameType(srcEnt.oldMode, dstEnt.newMode)) { pm.update(1); continue;
/** * Find the best match by file path for a given DiffEntry from a list of * DiffEntrys. The returned DiffEntry will be of the same type as <src>. If * no DiffEntry can be found that has the same type, this method will return * null. * * @param src * the DiffEntry to try to find a match for * @param list * a list of DiffEntrys to search through * @return the DiffEntry from <list> who's file path best matches <src> */ private static DiffEntry bestPathMatch(DiffEntry src, List<DiffEntry> list) { DiffEntry best = null; int score = -1; for (DiffEntry d : list) { if (sameType(mode(d), mode(src))) { int tmp = SimilarityRenameDetector .nameScore(path(d), path(src)); if (tmp > score) { best = d; score = tmp; } } } return best; }
/** * Find the best match by file path for a given DiffEntry from a list of * DiffEntrys. The returned DiffEntry will be of the same type as <src>. If * no DiffEntry can be found that has the same type, this method will return * null. * * @param src * the DiffEntry to try to find a match for * @param list * a list of DiffEntrys to search through * @return the DiffEntry from <list> who's file path best matches <src> */ private static DiffEntry bestPathMatch(DiffEntry src, List<DiffEntry> list) { DiffEntry best = null; int score = -1; for (DiffEntry d : list) { if (sameType(mode(d), mode(src))) { int tmp = SimilarityRenameDetector .nameScore(path(d), path(src)); if (tmp > score) { best = d; score = tmp; } } } return best; }
if (RenameDetector.sameType(entry.oldMode, entry.newMode)) r.add(entry); else
if (RenameDetector.sameType(entry.oldMode, entry.newMode)) r.add(entry); else