diff --git a/platform/dvcs/testFramework/com/intellij/dvcs/test/MockVcsHelper.java b/platform/dvcs/testFramework/com/intellij/dvcs/test/MockVcsHelper.java index 98884e6e2b24..da6f7524d248 100644 --- a/platform/dvcs/testFramework/com/intellij/dvcs/test/MockVcsHelper.java +++ b/platform/dvcs/testFramework/com/intellij/dvcs/test/MockVcsHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -145,7 +145,7 @@ public class MockVcsHelper extends AbstractVcsHelper { } @Override - public void showFileHistory(VcsHistoryProvider vcsHistoryProvider, FilePath path, AbstractVcs vcs, String repositoryPath) { + public void showFileHistory(VcsHistoryProvider vcsHistoryProvider, FilePath path, AbstractVcs vcs, RepositoryLocation repositoryLocation) { throw new UnsupportedOperationException(); } @@ -153,7 +153,7 @@ public class MockVcsHelper extends AbstractVcsHelper { public void showFileHistory(VcsHistoryProvider vcsHistoryProvider, AnnotationProvider annotationProvider, FilePath path, - String repositoryPath, + RepositoryLocation repositoryLocation, AbstractVcs vcs) { throw new UnsupportedOperationException(); } diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/AbstractVcsHelper.java b/platform/vcs-api/src/com/intellij/openapi/vcs/AbstractVcsHelper.java index 68500e0a36a5..f7a2a682d2ae 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/AbstractVcsHelper.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/AbstractVcsHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -144,10 +144,10 @@ public abstract class AbstractVcsHelper { } public abstract void showFileHistory(VcsHistoryProvider vcsHistoryProvider, FilePath path, final AbstractVcs vcs, - final String repositoryPath); + final RepositoryLocation repositoryLocation); public abstract void showFileHistory(VcsHistoryProvider vcsHistoryProvider, AnnotationProvider annotationProvider, FilePath path, - final String repositoryPath, final AbstractVcs vcs); + final RepositoryLocation repositoryLocation, final AbstractVcs vcs); /** * Shows the "Rollback Changes" dialog with the specified list of changes. diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAnnotationCachedProxy.java b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAnnotationCachedProxy.java index 177ee6813347..65acd621a0df 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAnnotationCachedProxy.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAnnotationCachedProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -21,6 +21,7 @@ import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.util.ThrowableComputable; import com.intellij.openapi.vcs.AbstractVcs; import com.intellij.openapi.vcs.FilePath; +import com.intellij.openapi.vcs.RepositoryLocation; import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vcs.actions.VcsContextFactory; import com.intellij.openapi.vcs.annotate.AnnotationProvider; @@ -199,6 +200,12 @@ public class VcsAnnotationCachedProxy implements AnnotationProvider { public void beforeRefresh() { } + @Nullable + @Override + public RepositoryLocation getRepositoryLocation() { + return null; + } + @Override public void forceRefresh() { } diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAppendableHistoryPartnerAdapter.java b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAppendableHistoryPartnerAdapter.java index 08deafa059a3..1e795ddbe33f 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAppendableHistoryPartnerAdapter.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAppendableHistoryPartnerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -15,7 +15,9 @@ */ package com.intellij.openapi.vcs.history; +import com.intellij.openapi.vcs.RepositoryLocation; import com.intellij.openapi.vcs.VcsException; +import org.jetbrains.annotations.Nullable; /** * @author irengrig @@ -53,6 +55,12 @@ public class VcsAppendableHistoryPartnerAdapter implements VcsAppendableHistoryS public void beforeRefresh() { } + @Nullable + @Override + public RepositoryLocation getRepositoryLocation() { + return null; + } + public void check() throws VcsException { if (myException != null) throw myException; } diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAppendableHistorySessionPartner.java b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAppendableHistorySessionPartner.java index 48f5ad7503b1..e60917c1da81 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAppendableHistorySessionPartner.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAppendableHistorySessionPartner.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -15,7 +15,9 @@ */ package com.intellij.openapi.vcs.history; +import com.intellij.openapi.vcs.RepositoryLocation; import com.intellij.openapi.vcs.VcsException; +import org.jetbrains.annotations.Nullable; public interface VcsAppendableHistorySessionPartner { void reportCreatedEmptySession(VcsAbstractHistorySession session); @@ -24,4 +26,7 @@ public interface VcsAppendableHistorySessionPartner { void finished(); void forceRefresh(); void beforeRefresh(); + + @Nullable + RepositoryLocation getRepositoryLocation(); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryRefresher.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryRefresher.java index c70cb0d361de..73cf2535ff30 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryRefresher.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryRefresher.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -17,6 +17,7 @@ package com.intellij.openapi.vcs.history; import com.intellij.openapi.vcs.AbstractVcs; import com.intellij.openapi.vcs.FilePath; +import com.intellij.openapi.vcs.RepositoryLocation; import com.intellij.openapi.vcs.annotate.AnnotationProvider; /** @@ -35,12 +36,12 @@ public class FileHistoryRefresher implements FileHistoryRefresherI { public FileHistoryRefresher(final VcsHistoryProvider vcsHistoryProvider, final AnnotationProvider annotationProvider, final FilePath path, - final String repositoryPath, + final RepositoryLocation repositoryLocation, final AbstractVcs vcs) { myVcsHistoryProvider = vcsHistoryProvider; myPath = path; myVcs = vcs; - mySessionPartner = new FileHistorySessionPartner(vcsHistoryProvider, annotationProvider, path, repositoryPath, vcs, this); + mySessionPartner = new FileHistorySessionPartner(vcsHistoryProvider, annotationProvider, path, repositoryLocation, vcs, this); myCanUseCache = true; } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistorySessionPartner.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistorySessionPartner.java index a0a02b6cfa5e..a360ba4935dc 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistorySessionPartner.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistorySessionPartner.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -17,10 +17,7 @@ package com.intellij.openapi.vcs.history; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.ui.MessageType; -import com.intellij.openapi.vcs.AbstractVcs; -import com.intellij.openapi.vcs.FilePath; -import com.intellij.openapi.vcs.VcsBundle; -import com.intellij.openapi.vcs.VcsException; +import com.intellij.openapi.vcs.*; import com.intellij.openapi.vcs.annotate.AnnotationProvider; import com.intellij.openapi.vcs.ex.ProjectLevelVcsManagerEx; import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier; @@ -33,6 +30,7 @@ import com.intellij.ui.content.ContentManager; import com.intellij.util.BufferedListConsumer; import com.intellij.util.Consumer; import com.intellij.util.ContentsUtil; +import org.jetbrains.annotations.Nullable; import java.util.List; @@ -45,7 +43,7 @@ public class FileHistorySessionPartner implements VcsAppendableHistorySessionPar private final VcsHistoryProvider myVcsHistoryProvider; private final AnnotationProvider myAnnotationProvider; private final FilePath myPath; - private final String myRepositoryPath; + private final RepositoryLocation myRepositoryLocation; private final AbstractVcs myVcs; private final FileHistoryRefresherI myRefresherI; private volatile VcsAbstractHistorySession mySession; @@ -53,14 +51,14 @@ public class FileHistorySessionPartner implements VcsAppendableHistorySessionPar public FileHistorySessionPartner(final VcsHistoryProvider vcsHistoryProvider, final AnnotationProvider annotationProvider, final FilePath path, - final String repositoryPath, + final RepositoryLocation repositoryLocation, final AbstractVcs vcs, final FileHistoryRefresherI refresherI) { myVcsHistoryProvider = vcsHistoryProvider; myAnnotationProvider = annotationProvider; myPath = path; myLimitHistoryCheck = new LimitHistoryCheck(vcs.getProject(), path.getPath()); - myRepositoryPath = repositoryPath; + myRepositoryLocation = repositoryLocation; myVcs = vcs; myRefresherI = refresherI; myBuffer = new BufferedListConsumer(5, new Consumer>() { @@ -76,6 +74,12 @@ public class FileHistorySessionPartner implements VcsAppendableHistorySessionPar }, 1000); } + @Nullable + @Override + public RepositoryLocation getRepositoryLocation() { + return myRepositoryLocation; + } + public void acceptRevision(VcsFileRevision revision) { myLimitHistoryCheck.checkNumber(); myBuffer.consumeOne(revision); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsHistoryProviderBackgroundableProxy.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsHistoryProviderBackgroundableProxy.java index a8dbb74f4273..60d7568233e7 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsHistoryProviderBackgroundableProxy.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsHistoryProviderBackgroundableProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -221,6 +221,12 @@ public class VcsHistoryProviderBackgroundableProxy { myPartner.beforeRefresh(); } + @Nullable + @Override + public RepositoryLocation getRepositoryLocation() { + return myPartner.getRepositoryLocation(); + } + @Override public void forceRefresh() { myPartner.forceRefresh(); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/AbstractVcsHelperImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/AbstractVcsHelperImpl.java index 1ad3f1dba517..32357d68fbaf 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/AbstractVcsHelperImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/AbstractVcsHelperImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -116,13 +116,13 @@ public class AbstractVcsHelperImpl extends AbstractVcsHelper { } public void showFileHistory(final VcsHistoryProvider vcsHistoryProvider, final FilePath path, final AbstractVcs vcs, - final String repositoryPath) { - showFileHistory(vcsHistoryProvider, null, path, repositoryPath, vcs); + final RepositoryLocation repositoryLocation) { + showFileHistory(vcsHistoryProvider, null, path, repositoryLocation, vcs); } public void showFileHistory(final VcsHistoryProvider vcsHistoryProvider, final AnnotationProvider annotationProvider, final FilePath path, - final String repositoryPath, final AbstractVcs vcs) { - final FileHistoryRefresherI refresherI = new FileHistoryRefresher(vcsHistoryProvider, annotationProvider, path, repositoryPath, vcs); + final RepositoryLocation repositoryLocation, final AbstractVcs vcs) { + final FileHistoryRefresherI refresherI = new FileHistoryRefresher(vcsHistoryProvider, annotationProvider, path, repositoryLocation, vcs); refresherI.run(false, true); } diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/cvsBrowser/ui/BrowserPanel.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/cvsBrowser/ui/BrowserPanel.java index 4f0d380646af..643657de6595 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/cvsBrowser/ui/BrowserPanel.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/cvsBrowser/ui/BrowserPanel.java @@ -35,11 +35,9 @@ import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.fileEditor.OpenFileDescriptor; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; -import com.intellij.openapi.vcs.AbstractVcsHelper; -import com.intellij.openapi.vcs.VcsBundle; -import com.intellij.openapi.vcs.VcsConfiguration; -import com.intellij.openapi.vcs.VcsException; +import com.intellij.openapi.vcs.*; import com.intellij.openapi.vcs.annotate.FileAnnotation; +import com.intellij.openapi.vcs.history.VcsHistoryProvider; import com.intellij.openapi.vcs.vfs.VcsVirtualFile; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.pom.Navigatable; @@ -88,8 +86,7 @@ public class BrowserPanel extends JPanel implements DataProvider, CvsTabbedWindo DefaultActionGroup result = new DefaultActionGroup(); result.add(new EditSourceAction()); result.add(new MyCheckoutAction()); - //TODO lesya - //result.add(new ShowLightCvsFileHistoryAction()); + result.add(new MyHistoryAction()); result.add(new MyAnnotateAction()); result.add(new BrowseChangesAction()); return result; @@ -154,6 +151,33 @@ public class BrowserPanel extends JPanel implements DataProvider, CvsTabbedWindo } } + private class MyHistoryAction extends AnAction implements DumbAware { + public MyHistoryAction() { + super(CvsBundle.message("operation.name.show.file.history"), + CvsBundle.message("operation.name.show.file.history.description"), AllIcons.Vcs.History); + } + + public void update(AnActionEvent e) { + Presentation presentation = e.getPresentation(); + presentation.setVisible(true); + CvsLightweightFile cvsLightFile = getCvsLightFile(); + presentation.setEnabled(cvsLightFile != null && cvsLightFile.getCvsFile() != null); + } + + public void actionPerformed(AnActionEvent e) { + CvsElement[] currentSelection = myTree.getCurrentSelection(); + if (currentSelection.length != 1) return; + final CvsElement cvsElement = currentSelection[0]; + final VirtualFile virtualFile = cvsElement.getVirtualFile(); + if (virtualFile == null || virtualFile.isDirectory()) return; + final CvsVcs2 vcs = CvsVcs2.getInstance(myProject); + final VcsHistoryProvider historyProvider = vcs.getVcsHistoryProvider(); + final String moduleName = cvsElement.getElementPath(); + final CvsRepositoryLocation location = new CvsRepositoryLocation(null, myCvsRootConfiguration, moduleName); + AbstractVcsHelper.getInstance(myProject).showFileHistory(historyProvider, new FilePathImpl(virtualFile), vcs, location); + } + } + private class MyAnnotateAction extends AnAction implements DumbAware { public MyAnnotateAction() { super(CvsBundle.message("operation.name.annotate"), null, AllIcons.Actions.Annotate); diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/history/CvsHistoryProvider.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/history/CvsHistoryProvider.java index ab3bba99b2e7..4ab9e03f7d09 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/history/CvsHistoryProvider.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/history/CvsHistoryProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -19,7 +19,9 @@ import com.intellij.CvsBundle; import com.intellij.cvsSupport2.CvsUtil; import com.intellij.cvsSupport2.application.CvsEntriesManager; import com.intellij.cvsSupport2.changeBrowser.CvsChangeList; +import com.intellij.cvsSupport2.changeBrowser.CvsRepositoryLocation; import com.intellij.cvsSupport2.connections.CvsConnectionSettings; +import com.intellij.cvsSupport2.connections.CvsEnvironment; import com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor; import com.intellij.cvsSupport2.cvsExecution.DefaultCvsOperationExecutorCallback; import com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler; @@ -201,9 +203,17 @@ public class CvsHistoryProvider implements VcsHistoryProvider { } public void reportAppendableHistory(FilePath path, VcsAppendableHistorySessionPartner partner) throws VcsException { - // todo some time after ... this could be done - final VcsHistorySession session = createSessionFor(path); - partner.reportCreatedEmptySession((VcsAbstractHistorySession) session); + final CvsRepositoryLocation location = (CvsRepositoryLocation)partner.getRepositoryLocation(); + final VcsHistorySession session; + if (location != null) { + final List fileRevisionList = createRevisions(location.getEnvironment(), path.getIOFile()); + if (fileRevisionList == null) return; + session = new MyHistorySession(fileRevisionList, path); + } + else { + session = createSessionFor(path); + } + partner.reportCreatedEmptySession((VcsAbstractHistorySession)session); } private static VcsRevisionNumber getCurrentRevision(FilePath filePath) { @@ -222,21 +232,26 @@ public class CvsHistoryProvider implements VcsHistoryProvider { final VirtualFile root = CvsVfsUtil.refreshAndFindFileByIoFile(file.getParentFile()); // check if we have a history pane open for a file in a package which has just been deleted if (root == null) return null; - final LocalPathIndifferentLogOperation logOperation = new LocalPathIndifferentLogOperation(file); + final CvsConnectionSettings env = CvsEntriesManager.getInstance().getCvsConnectionSettingsFor(filePath.getVirtualFileParent()); + final File lightweightFileForFile = CvsUtil.getCvsLightweightFileForFile(file); + return createRevisions(env, lightweightFileForFile); + } + + private List createRevisions(final CvsEnvironment connectionSettings, final File lightweightFileForFile) { + final LocalPathIndifferentLogOperation logOperation = new LocalPathIndifferentLogOperation(connectionSettings); + logOperation.addFile(lightweightFileForFile); final CvsOperationExecutor executor = new CvsOperationExecutor(myProject); final ArrayList result = new ArrayList(); executor.performActionSync(new CommandCvsHandler(CvsBundle.message("operation.name.load.file.content"), logOperation), new DefaultCvsOperationExecutorCallback() { @Override public void executionFinishedSuccessfully() { - final CvsConnectionSettings env = CvsEntriesManager.getInstance() - .getCvsConnectionSettingsFor(filePath.getVirtualFileParent()); final LogInformation firstLogInformation = logOperation.getFirstLogInformation(); if (firstLogInformation != null) { final List revisionList = firstLogInformation.getRevisionList(); for (Revision revision : revisionList) { - result.add(new CvsFileRevisionImpl(revision, CvsUtil.getCvsLightweightFileForFile(file), - firstLogInformation, env, myProject)); + result.add(new CvsFileRevisionImpl(revision, lightweightFileForFile, + firstLogInformation, connectionSettings, myProject)); } } } diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgMockVcsHelper.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgMockVcsHelper.java index 301fd8be594b..d646170229c7 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgMockVcsHelper.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgMockVcsHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -124,14 +124,14 @@ public class HgMockVcsHelper extends AbstractVcsHelper { } @Override - public void showFileHistory(VcsHistoryProvider vcsHistoryProvider, FilePath path, AbstractVcs vcs, String repositoryPath) { + public void showFileHistory(VcsHistoryProvider vcsHistoryProvider, FilePath path, AbstractVcs vcs, RepositoryLocation repositoryLocation) { } @Override public void showFileHistory(VcsHistoryProvider vcsHistoryProvider, AnnotationProvider annotationProvider, FilePath path, - String repositoryPath, + RepositoryLocation repositoryLocation, AbstractVcs vcs) { } diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserDialog.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserDialog.java index a6da5c5f7cb3..5c204c9cb456 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserDialog.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -351,9 +351,10 @@ public class RepositoryBrowserDialog extends DialogWrapper { boolean isDirectory = node.getUserObject() instanceof SVNURL || (node.getSVNDirEntry() != null && node.getSVNDirEntry().getKind() == SVNNodeKind.DIR); String url = node.getURL().toDecodedString(); + final SvnRepositoryLocation repositoryLocation = new SvnRepositoryLocation(node.getURL().toString()); AbstractVcsHelper.getInstance(myProject) - .showFileHistory(myVCS.getVcsHistoryProvider(), VcsUtil.getFilePathOnNonLocal(url, isDirectory), myVCS, url); + .showFileHistory(myVCS.getVcsHistoryProvider(), VcsUtil.getFilePathOnNonLocal(url, isDirectory), myVCS, repositoryLocation); node.reload(false); } } diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnHistoryTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnHistoryTest.java index a88e4561bdb6..ae867ab9de3a 100644 --- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnHistoryTest.java +++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnHistoryTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -25,6 +25,7 @@ import com.intellij.openapi.vcs.history.VcsFileRevision; import com.intellij.openapi.vcs.history.VcsHistoryProvider; import com.intellij.util.concurrency.Semaphore; import junit.framework.Assert; +import org.jetbrains.annotations.Nullable; import org.junit.Test; /** @@ -77,6 +78,12 @@ public class SvnHistoryTest extends Svn17TestCase { public void beforeRefresh() { } + @Nullable + @Override + public RepositoryLocation getRepositoryLocation() { + return null; + } + @Override public void forceRefresh() { } @@ -127,6 +134,12 @@ public class SvnHistoryTest extends Svn17TestCase { public void beforeRefresh() { } + @Nullable + @Override + public RepositoryLocation getRepositoryLocation() { + return null; + } + @Override public void forceRefresh() { } @@ -176,6 +189,12 @@ public class SvnHistoryTest extends Svn17TestCase { public void beforeRefresh() { } + @Nullable + @Override + public RepositoryLocation getRepositoryLocation() { + return null; + } + @Override public void forceRefresh() { } @@ -229,6 +248,12 @@ public class SvnHistoryTest extends Svn17TestCase { public void beforeRefresh() { } + @Nullable + @Override + public RepositoryLocation getRepositoryLocation() { + return null; + } + @Override public void forceRefresh() { } @@ -283,6 +308,12 @@ public class SvnHistoryTest extends Svn17TestCase { public void beforeRefresh() { } + @Nullable + @Override + public RepositoryLocation getRepositoryLocation() { + return null; + } + @Override public void forceRefresh() { } @@ -317,6 +348,12 @@ public class SvnHistoryTest extends Svn17TestCase { public void beforeRefresh() { } + @Nullable + @Override + public RepositoryLocation getRepositoryLocation() { + return null; + } + @Override public void forceRefresh() { } @@ -350,6 +387,12 @@ public class SvnHistoryTest extends Svn17TestCase { public void beforeRefresh() { } + @Nullable + @Override + public RepositoryLocation getRepositoryLocation() { + return null; + } + @Override public void forceRefresh() { }