/*
 * Copyright 2000-2005 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jetbrains.idea.svn;

import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.changes.ContentRevision;
import com.intellij.openapi.vcs.diff.DiffProvider;
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.peer.PeerFactory;
import org.tmatesoft.svn.core.wc.SVNRevision;

public class SvnDiffProvider implements DiffProvider {
  private SvnVcs myVcs;

  public SvnDiffProvider(final SvnVcs vcs) {
    myVcs = vcs;
  }

  public VcsRevisionNumber getCurrentRevision(VirtualFile file) {
    return new SvnRevisionNumber(SVNRevision.BASE);
  }

  public VcsRevisionNumber getLastRevision(VirtualFile file) {
    return new SvnRevisionNumber(SVNRevision.HEAD);
  }

  public ContentRevision createFileContent(final VcsRevisionNumber revisionNumber, final VirtualFile selectedFile) {
    final SVNRevision svnRevision = ((SvnRevisionNumber)revisionNumber).getRevision();
    FilePath filePath = PeerFactory.getInstance().getVcsContextFactory().createFilePathOn(selectedFile);
    return SvnContentRevision.createRemote(myVcs, filePath, svnRevision);
  }
}

@@ -881,16 +881,63 @@
 alFile;%0A
+import com.intellij.openapi.diagnostic.Logger;%0A
 import c
@@ -1016,273 +1016,804 @@
 on;%0A
-%0Apublic class SvnDiffProvider implements DiffProvider %7B%0A  private SvnVcs myVcs;%0A%0A  public SvnDiffProvider(final SvnVcs vcs) %7B%0A    myVcs = vcs;%0A  %7D%0A%0A  public VcsRevisionNumber getCurrentRevision(VirtualFile file) %7B%0A    return new SvnRevisionNumber(SVNRevision.BASE);
+import org.tmatesoft.svn.core.wc.SVNStatusClient;%0Aimport org.tmatesoft.svn.core.wc.SVNStatus;%0Aimport org.tmatesoft.svn.core.SVNException;%0A%0Aimport java.io.File;%0A%0Apublic class SvnDiffProvider implements DiffProvider %7B%0A  private static final Logger LOG = Logger.getInstance(%22#org.jetbrains.idea.svn.SvnDiffProvider%22);%0A  private SvnVcs myVcs;%0A%0A  public SvnDiffProvider(final SvnVcs vcs) %7B%0A    myVcs = vcs;%0A  %7D%0A%0A  public VcsRevisionNumber getCurrentRevision(VirtualFile file) %7B%0A    final SVNStatusClient client = myVcs.createStatusClient();%0A    try %7B%0A      final SVNStatus svnStatus = client.doStatus(new File(file.getPresentableUrl()), false, false);%0A      return new SvnRevisionNumber(svnStatus.getCommittedRevision());%0A    %7D%0A    catch (SVNException e) %7B%0A      LOG.error(e);%0A      return null;%0A    %7D
 %0A  %7D

return real revision number, for incoming changes refresh to work