[svn] fix ContentRevision creation for locally non-existing directory

If local path is null, the directory flag should be passed explicitly.
This commit is contained in:
Kirill Likhodedov
2015-05-28 15:16:51 +03:00
parent 7b1f4f056a
commit 0b1e2aef8d
2 changed files with 14 additions and 4 deletions
@@ -355,9 +355,10 @@ public class SvnChangeList implements CommittedChangeList {
return Boolean.FALSE;
}
});
final SvnRepositoryContentRevision contentRevision =
SvnRepositoryContentRevision.create(myVcs, myRepositoryRoot, path, localPath, getRevision(isBeforeRevision));
return contentRevision;
long revision = getRevision(isBeforeRevision);
return localPath == null
? SvnRepositoryContentRevision.createForRemotePath(myVcs, myRepositoryRoot, path, knownAsDirectory, revision)
: SvnRepositoryContentRevision.create(myVcs, myRepositoryRoot, path, localPath, revision);
}
public List<Change> getList() {
@@ -120,6 +120,15 @@ public class SvnRepositoryContentRevision implements ContentRevision, MarkerVcsC
return create(vcs, SvnUtil.appendMultiParts(repositoryRoot, path), localPath, revision);
}
public static SvnRepositoryContentRevision createForRemotePath(@NotNull SvnVcs vcs,
@NotNull String repositoryRoot,
@NotNull String path,
boolean isDirectory,
long revision) {
FilePath remotePath = VcsUtil.getFilePathOnNonLocal(SvnUtil.appendMultiParts(repositoryRoot, path), isDirectory);
return create(vcs, remotePath, remotePath, revision);
}
public static SvnRepositoryContentRevision create(@NotNull SvnVcs vcs,
@NotNull String fullPath,
@Nullable FilePath localPath,
@@ -127,7 +136,7 @@ public class SvnRepositoryContentRevision implements ContentRevision, MarkerVcsC
// TODO: Check if isDirectory = false always true for this method calls
FilePath remotePath = VcsUtil.getFilePathOnNonLocal(fullPath, false);
return create(vcs, remotePath, localPath, revision);
return create(vcs, remotePath, localPath == null ? remotePath : localPath, revision);
}
public static SvnRepositoryContentRevision create(@NotNull SvnVcs vcs,