Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 22, 2025. It is now read-only.

Commit 94c435a

Browse files
committed
TFSContentRevision: fix issue with history view
Previously, we were always doing diff on the local version of the file.
1 parent e0c802b commit 94c435a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

plugin/resources/META-INF/plugin.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<li>Check the build status of your repository and queue a new build if desired.</li>
4242
<li>Supports proxy settings configured in the IDE's System Settings section.</li>
4343
<li>Edit cached project information through configuration management.</li>
44+
<li>History view: fixed an issue where we were always performing a diff operation on the local file version.</li>
4445
</ul>
4546
<br />
4647
<br />

plugin/src/com/microsoft/alm/plugin/idea/tfvc/core/revision/TFSContentRevision.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,15 @@ public VcsRevisionNumber getRevisionNumber() {
132132
@Nullable
133133
public String getContent() throws VcsException {
134134
FilePath filePath = getFile();
135+
TFSContentStore contentStore;
135136
try {
136137
// Download the file if required:
137-
TFSContentStoreFactory.findOrCreate(filePath.getPath(), getChangeset(), getFilePath(), project);
138+
contentStore = TFSContentStoreFactory.findOrCreate(filePath.getPath(), getChangeset(), getFilePath(), project);
138139
} catch (IOException e) {
139140
throw new VcsException(e);
140141
}
141142

142-
VirtualFile virtualFile = Objects.requireNonNull(filePath.getVirtualFile());
143+
VirtualFile virtualFile = Objects.requireNonNull(VfsUtil.findFileByIoFile(contentStore.getTmpFile(), true));
143144
try {
144145
return VfsUtil.loadText(virtualFile);
145146
} catch (IOException e) {

0 commit comments

Comments
 (0)