mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
revert: Patches: find a nearest candidate for update/move. The first priority is location then hash.
This commit is contained in:
@@ -49,13 +49,14 @@ public class DiffCalculator {
|
||||
|
||||
for (Map.Entry<String, Long> create : toCreate.entrySet()) {
|
||||
if (Digester.isFile(create.getValue())) {
|
||||
List<String> sameName = byName.get(new File(create.getKey()).getName());
|
||||
String source = findBestCandidateForMove(sameName, create.getKey());
|
||||
boolean move = false;
|
||||
|
||||
List<String> sameContent = byContent.get(create.getValue());
|
||||
if (source != null && source.equals(findBestCandidateForMove(sameContent, create.getKey()))) {
|
||||
move = true;
|
||||
String source = findBestCandidateForMove(sameContent, create.getKey());
|
||||
boolean move = true;
|
||||
|
||||
if (source == null) {
|
||||
List<String> sameName = byName.get(new File(create.getKey()).getName());
|
||||
source = findBestCandidateForMove(sameName, create.getKey());
|
||||
move = false;
|
||||
}
|
||||
|
||||
if (source != null && !critical.contains(source)) {
|
||||
@@ -99,8 +100,8 @@ public class DiffCalculator {
|
||||
if (i + 1 > common) {
|
||||
best = other;
|
||||
common = i + 1;
|
||||
// check root folders of candidates with the same matches
|
||||
}
|
||||
// check root folders of candidates with the same matches
|
||||
else if (i + 1 == common && compareRootFolders(dirs, best.split("/")) < compareRootFolders(dirs, other.split("/"))) {
|
||||
best = other;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user