Merge branch 'master' of git.labs.intellij.net:idea/community
authorirengrig <Irina.Chernushina@jetbrains.com>
Tue, 8 Jun 2010 12:56:28 +0000 (16:56 +0400)
committerirengrig <Irina.Chernushina@jetbrains.com>
Tue, 8 Jun 2010 12:56:28 +0000 (16:56 +0400)
218 files changed:
1  2 
java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java
java/execution/openapi/src/com/intellij/execution/JavaExecutionUtil.java
java/java-impl/src/com/intellij/codeInsight/completion/DefaultInsertHandler.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ChangeMethodSignatureFromUsageFix.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RemoveRedundantElseAction.java
java/java-impl/src/com/intellij/codeInsight/intention/impl/AddDeprecationAnnotationFix.java
java/java-impl/src/com/intellij/codeInsight/intention/impl/AddNullableNotNullAnnotationFix.java
java/java-impl/src/com/intellij/codeInsight/intention/impl/AddOnDemandStaticImportAction.java
java/java-impl/src/com/intellij/codeInsight/intention/impl/AddSingleMemberStaticImportAction.java
java/java-impl/src/com/intellij/codeInsight/intention/impl/ColorChooserIntentionAction.java
java/java-impl/src/com/intellij/codeInsight/intention/impl/InvertIfConditionAction.java
java/java-impl/src/com/intellij/codeInsight/intention/impl/MoveInitializerToConstructorAction.java
java/java-impl/src/com/intellij/codeInsight/intention/impl/SplitDeclarationAction.java
java/java-impl/src/com/intellij/codeInsight/intention/impl/SplitIfAction.java
java/java-impl/src/com/intellij/refactoring/introduceField/BaseExpressionToFieldHandler.java
java/java-impl/src/com/intellij/refactoring/rename/RenameJavaClassProcessor.java
java/java-impl/src/com/intellij/refactoring/util/duplicates/DuplicatesFinder.java
java/java-impl/src/com/intellij/refactoring/util/duplicates/MethodDuplicatesHandler.java
java/java-tests/testData/refactoring/inlineLocal/Wildcard.java
java/java-tests/testSrc/com/intellij/refactoring/ExtractEnumTest.java
java/java-tests/testSrc/com/intellij/refactoring/ExtractMethodTest.java
java/java-tests/testSrc/com/intellij/refactoring/IntroduceFieldInSameClassTest.java
java/java-tests/testSrc/com/intellij/refactoring/RenameCollisionsTest.java
java/java-tests/testSrc/com/intellij/refactoring/ReplaceConstructorWithBuilderTest.java
platform/lang-api/src/com/intellij/execution/junit/RuntimeConfigurationProducer.java
platform/lang-impl/src/com/intellij/codeInsight/problems/WolfTheProblemSolverImpl.java
platform/lang-impl/src/com/intellij/execution/ExecutorRegistryImpl.java
platform/lang-impl/src/com/intellij/execution/actions/RunContextAction.java
platform/lang-impl/src/com/intellij/execution/impl/ConfigurationSettingsEditorWrapper.java
platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.java
platform/lang-impl/src/com/intellij/execution/rmi/RemoteProcessSupport.java
platform/lang-impl/src/com/intellij/ide/projectView/BaseProjectTreeBuilder.java
platform/lang-impl/src/com/intellij/openapi/wm/impl/status/TogglePopupHintsPanel.java
platform/lang-impl/src/com/intellij/refactoring/move/moveFilesOrDirectories/MoveFilesOrDirectoriesDialog.java
platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeBuilder.java
platform/platform-api/src/com/intellij/openapi/wm/StatusBar.java
platform/platform-api/src/com/intellij/ui/ListScrollingUtil.java
platform/platform-api/src/com/intellij/util/ui/AnimatedIcon.java
platform/platform-impl/src/com/intellij/diagnostic/IdeMessagePanel.java
platform/platform-impl/src/com/intellij/notification/impl/IdeNotificationArea.java
platform/platform-impl/src/com/intellij/notification/impl/ProjectNotificationsComponent.java
platform/platform-impl/src/com/intellij/openapi/command/impl/DocumentReferenceManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapImpl.java
platform/platform-impl/src/com/intellij/openapi/wm/ex/StatusBarEx.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeFrameImpl.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeRootPane.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/TestWindowManager.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/status/EncodingPanel.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/status/IdeStatusBarImpl.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InlineProgressIndicator.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InsertOverwritePanel.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/status/MemoryUsagePanel.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PositionPanel.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ShowProcessWindowAction.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/status/TextPanel.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ToggleReadOnlyAttributePanel.java
platform/platform-impl/testSrc/com/intellij/ide/util/treeView/BaseTreeTestCase.java
platform/platform-impl/testSrc/com/intellij/ide/util/treeView/TreeUiTest.java
platform/util/src/com/intellij/openapi/diagnostic/Log.java
platform/util/src/com/intellij/util/ui/UIUtil.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/IncomingChangesIndicator.java
plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/JavaLanguageInjectionSupport.java
plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java
plugins/git4idea/src/git4idea/checkin/GitCheckinEnvironment.java
plugins/groovy/src/org/intellij/plugins/intelliLang/inject/groovy/PatternEditorContextMembersProvider.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/api/statements/GrTryCatchStatement.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/arguments/GrArgumentLabelImpl.java
plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduceParameter/java2groovy/GroovyIntroduceParameterMethodUsagesProcessor.java
plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GroovyCompilerTest.groovy
plugins/groovy/testdata/refactoring/changeSignatureForJava/CovariantReturnType.java
plugins/groovy/testdata/refactoring/changeSignatureForJava/CovariantReturnType_after.java
plugins/hg4idea/src/org/zmlx/hg4idea/HgContentRevision.java
plugins/hg4idea/src/org/zmlx/hg4idea/HgCurrentBranchStatusUpdater.java
plugins/hg4idea/src/org/zmlx/hg4idea/HgErrorHandler.java
plugins/hg4idea/src/org/zmlx/hg4idea/HgExecutableValidator.java
plugins/hg4idea/src/org/zmlx/hg4idea/HgFileRevision.java
plugins/hg4idea/src/org/zmlx/hg4idea/HgIdeConfigurable.java
plugins/hg4idea/src/org/zmlx/hg4idea/HgIncomingStatusUpdater.java
plugins/hg4idea/src/org/zmlx/hg4idea/HgOutgoingStatusUpdater.java
plugins/hg4idea/src/org/zmlx/hg4idea/HgProjectConfigurable.java
plugins/hg4idea/src/org/zmlx/hg4idea/HgRevisionNumber.java
plugins/hg4idea/src/org/zmlx/hg4idea/HgUtil.java
plugins/hg4idea/src/org/zmlx/hg4idea/HgVcs.java
plugins/hg4idea/src/org/zmlx/hg4idea/HgVirtualFileListener.java
plugins/hg4idea/src/org/zmlx/hg4idea/action/HgAbstractFilesAction.java
plugins/hg4idea/src/org/zmlx/hg4idea/action/HgAbstractGlobalAction.java
plugins/hg4idea/src/org/zmlx/hg4idea/action/HgMarkResolved.java
plugins/hg4idea/src/org/zmlx/hg4idea/action/HgMercurialMenu.java
plugins/hg4idea/src/org/zmlx/hg4idea/action/HgMqRebaseAction.java
plugins/hg4idea/src/org/zmlx/hg4idea/action/HgRunConflictResolverAction.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgCatCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgChangesetsCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgCloneCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgCommandAuthenticator.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgCommandResult.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgCommandService.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgCommitCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgHeadsCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgIdentifyCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgIncomingCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgLogCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgMergeCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgOutgoingCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgParentsCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgPullCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgPushCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgResolveCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgRevertCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgRevisionsCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgStatusCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgTrackFileNamesAccrossRevisionsCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgVersionCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgWorkingCopyRevisionsCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/ShellCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/SocketServer.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCachingCommitedChangesProvider.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgChangeProvider.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCheckoutProvider.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCommitedChangeList.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCurrentBinaryContentRevision.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCurrentContentRevision.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgDiffProvider.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgHistoryProvider.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgRollbackEnvironment.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/annotate/HgAnnotation.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/annotate/HgAnnotationProvider.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/commit/HgCheckinEnvironment.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/commit/HgCommitSession.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/update/HgConflictResolver.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/update/HgHeadMerger.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/update/HgIntegrateEnvironment.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/update/HgRegularUpdater.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/update/HgUpdateEnvironment.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/update/HgUpdater.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/update/HgUpdaterFactory.java
plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgChangesetStatus.java
plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgCloneDialog.java
plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgConfigurationIdePanel.java
plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgCurrentBranchStatus.java
plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgIntegrateDialog.java
plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgUpdateDialog.java
plugins/hg4idea/testSrc/org/zmlx/hg4idea/AbstractHgTestCase.java
plugins/hg4idea/testSrc/org/zmlx/hg4idea/HgAddTestCase.java
plugins/hg4idea/testSrc/org/zmlx/hg4idea/HgCatTestCase.java
plugins/hg4idea/testSrc/org/zmlx/hg4idea/HgCopyTestCase.java
plugins/hg4idea/testSrc/org/zmlx/hg4idea/HgDeleteTestCase.java
plugins/hg4idea/testSrc/org/zmlx/hg4idea/HgFromClonedTestCase.java
plugins/hg4idea/testSrc/org/zmlx/hg4idea/HgLogTestCase.java
plugins/hg4idea/testSrc/org/zmlx/hg4idea/HgMoveTestCase.java
plugins/hg4idea/testSrc/org/zmlx/hg4idea/HgRenameTestCase.java
plugins/hg4idea/testSrc/org/zmlx/hg4idea/HgResolveConflictTestCase.java
plugins/hg4idea/testSrc/org/zmlx/hg4idea/HgRevertTestCase.java
plugins/hg4idea/testSrc/org/zmlx/hg4idea/HgTestCase.java
plugins/hg4idea/testSrc/org/zmlx/hg4idea/HgUpdateTestCase.java
plugins/java-i18n/src/com/intellij/codeInspection/i18n/SuppressByCommentOutAction.java
plugins/maven/facade-api/src/org/jetbrains/idea/maven/facade/MavenFacadeEmbedder.java
plugins/maven/facade-api/src/org/jetbrains/idea/maven/facade/MavenFacadeProcessCanceledException.java
plugins/maven/facade-api/src/org/jetbrains/idea/maven/model/MavenBuild.java
plugins/maven/facade-api/src/org/jetbrains/idea/maven/model/MavenProfile.java
plugins/maven/facade-impl/src/org/jetbrains/idea/maven/facade/MavenFacadeLocator.java
plugins/maven/facade-impl/src/org/jetbrains/idea/maven/facade/embedder/CustomArtifactFactory.java
plugins/maven/facade-impl/src/org/jetbrains/idea/maven/facade/embedder/MavenFacadeIndexerImpl.java
plugins/maven/facade-impl/src/org/jetbrains/idea/maven/facade/nexus/ArtifactType.java
plugins/maven/facade-impl/src/org/jetbrains/idea/maven/facade/nexus/Endpoint.java
plugins/maven/facade-impl/src/org/jetbrains/idea/maven/facade/nexus/ObjectFactory.java
plugins/maven/facade-impl/src/org/jetbrains/idea/maven/facade/nexus/Repositories.java
plugins/maven/facade-impl/src/org/jetbrains/idea/maven/facade/nexus/RepositoryMetaData.java
plugins/maven/facade-impl/src/org/jetbrains/idea/maven/facade/nexus/SearchResult.java
plugins/maven/facade-impl/src/org/jetbrains/idea/maven/facade/nexus/SearchResults.java
plugins/maven/facade-impl/test/org/jetbrains/idea/maven/embedder/MavenFacadeEmbedderTest.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/compiler/MavenResourceCompiler.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/MavenDomUtil.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/converters/MavenArtifactCoordinatesArtifactIdConverter.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/converters/MavenArtifactCoordinatesConverter.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/converters/MavenParentRelativePathConverter.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/generate/GenerateDependencyAction.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/references/MavenPropertyPsiReference.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenExternalParameters.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunner.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunnerParametersConfigurable.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/importing/FacetImporter.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/importing/GroovyImporter.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/importing/MavenImporter.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/importing/MavenRootModelAdapter.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenArtifactSearchDialog.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenIndicesManager.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenProjectIndicesManager.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/navigator/MavenProjectsStructure.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenConsole.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenEmbeddersManager.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectReaderResult.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsManagerWatcher.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsProcessorEmptyTask.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenAttachSourcesProvider.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenPluginInfo.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/actions/MavenActionUtil.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/MavenFrameworkSupportProvider.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/MavenModuleWizardStep.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/MavenProjectBuilder.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/MavenProjectOpenProcessor.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/MavenCustomRepositoryHelper.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/MavenImportingTestCase.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenDomTestCase.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/FoldersImportingTest.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/InvalidProjectImportingTest.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesManagerTest.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesStressTest.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenPluginInfoReaderTest.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/wizards/MavenModuleBuilderTest.java
plugins/properties/src/com/intellij/lang/properties/PropertySuppressableInspectionBase.java
plugins/ui-designer/src/com/intellij/uiDesigner/snapShooter/CreateSnapShotAction.java
plugins/ui-designer/testSrc/com/intellij/uiDesigner/core/AsmCodeGeneratorTest.java
xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlInspectionToolProvider.java
xml/impl/src/com/intellij/javaee/ResourceRegistrarImpl.java
xml/impl/src/com/intellij/psi/formatter/xml/XmlBlock.java
xml/impl/src/com/intellij/psi/impl/source/xml/XmlDoctypeImpl.java
xml/openapi/src/com/intellij/codeInspection/XmlSuppressableInspectionTool.java

index 77b2a3f592d9596a8a15a173903b15ff0cd2909a,3e62d59e1d640b4aee7066228264de1439960139..484efcc227d072520f08352dc296463863f8bb95
   */
  package com.intellij.compiler.impl;
  
 -import com.intellij.*;
 -import com.intellij.analysis.*;
 +import com.intellij.CommonBundle;
 +import com.intellij.analysis.AnalysisScope;
  import com.intellij.compiler.*;
 -import com.intellij.compiler.make.*;
 -import com.intellij.compiler.progress.*;
 -import com.intellij.diagnostic.*;
 -import com.intellij.openapi.application.*;
 +import com.intellij.compiler.make.CacheCorruptedException;
 +import com.intellij.compiler.make.CacheUtils;
 +import com.intellij.compiler.make.DependencyCache;
 +import com.intellij.compiler.progress.CompilerTask;
 +import com.intellij.diagnostic.IdeErrorsDialog;
 +import com.intellij.diagnostic.PluginException;
 +import com.intellij.openapi.application.ApplicationManager;
 +import com.intellij.openapi.application.ModalityState;
  import com.intellij.openapi.compiler.*;
  import com.intellij.openapi.compiler.Compiler;
 -import com.intellij.openapi.compiler.ex.*;
 -import com.intellij.openapi.diagnostic.*;
 -import com.intellij.openapi.extensions.*;
 -import com.intellij.openapi.fileEditor.*;
 -import com.intellij.openapi.fileTypes.*;
 -import com.intellij.openapi.module.*;
 -import com.intellij.openapi.progress.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.projectRoots.*;
 +import com.intellij.openapi.compiler.ex.CompileContextEx;
 +import com.intellij.openapi.compiler.ex.CompilerPathsEx;
 +import com.intellij.openapi.diagnostic.Logger;
 +import com.intellij.openapi.extensions.Extensions;
 +import com.intellij.openapi.extensions.PluginId;
 +import com.intellij.openapi.fileEditor.FileDocumentManager;
 +import com.intellij.openapi.fileTypes.FileType;
 +import com.intellij.openapi.fileTypes.FileTypeManager;
 +import com.intellij.openapi.fileTypes.StdFileTypes;
 +import com.intellij.openapi.module.LanguageLevelUtil;
 +import com.intellij.openapi.module.Module;
 +import com.intellij.openapi.module.ModuleManager;
 +import com.intellij.openapi.progress.ProcessCanceledException;
 +import com.intellij.openapi.progress.ProgressIndicator;
 +import com.intellij.openapi.progress.ProgressManager;
 +import com.intellij.openapi.project.DumbService;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.project.ProjectBundle;
 +import com.intellij.openapi.projectRoots.Sdk;
  import com.intellij.openapi.roots.*;
 -import com.intellij.openapi.roots.ex.*;
 -import com.intellij.openapi.roots.ui.configuration.*;
 -import com.intellij.openapi.ui.*;
 +import com.intellij.openapi.roots.ex.ProjectRootManagerEx;
 +import com.intellij.openapi.roots.ui.configuration.CommonContentEntriesEditor;
 +import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService;
 +import com.intellij.openapi.ui.MessageType;
 +import com.intellij.openapi.ui.Messages;
  import com.intellij.openapi.util.*;
 -import com.intellij.openapi.util.io.*;
 -import com.intellij.openapi.util.registry.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.openapi.wm.*;
 -import com.intellij.packageDependencies.*;
 -import com.intellij.pom.java.*;
 -import com.intellij.psi.*;
 -import com.intellij.util.*;
 +import com.intellij.openapi.util.io.FileUtil;
 +import com.intellij.openapi.util.registry.Registry;
 +import com.intellij.openapi.vfs.LocalFileSystem;
 +import com.intellij.openapi.vfs.VfsUtil;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import com.intellij.openapi.vfs.VirtualFileManager;
- import com.intellij.openapi.wm.*;
++import com.intellij.openapi.wm.StatusBar;
++import com.intellij.openapi.wm.ToolWindowId;
++import com.intellij.openapi.wm.ToolWindowManager;
++import com.intellij.openapi.wm.WindowManager;
 +import com.intellij.packageDependencies.DependenciesBuilder;
 +import com.intellij.packageDependencies.ForwardDependenciesBuilder;
 +import com.intellij.pom.java.LanguageLevel;
 +import com.intellij.psi.PsiCompiledElement;
 +import com.intellij.psi.PsiDocumentManager;
 +import com.intellij.psi.PsiFile;
 +import com.intellij.psi.PsiManager;
 +import com.intellij.util.Chunk;
 +import com.intellij.util.LocalTimeCounter;
 +import com.intellij.util.StringBuilderSpinAllocator;
 +import com.intellij.util.ThrowableRunnable;
  import com.intellij.util.concurrency.Semaphore;
 -import com.intellij.util.containers.*;
 +import com.intellij.util.containers.ContainerUtil;
  import com.intellij.util.containers.HashMap;
 -import gnu.trove.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.util.containers.MultiMap;
 +import com.intellij.util.containers.OrderedSet;
 +import gnu.trove.TObjectHashingStrategy;
 +import org.jetbrains.annotations.NonNls;
 +import org.jetbrains.annotations.NotNull;
  
  import java.io.*;
  import java.util.*;
index da8876b181cfea85fe93f3473e0b4047045c8100,f1f5d082bf63aecfb8524ab5ac209331d6f39877..da7e9477770ba3e816e1c4f4afa5e7698c17ce11
@@@ -20,18 -20,18 +20,18 @@@ import com.intellij.execution.executors
  import com.intellij.execution.filters.Filter;
  import com.intellij.execution.filters.TextConsoleBuilder;
  import com.intellij.execution.filters.TextConsoleBuilderFactory;
--import com.intellij.execution.runners.ProgramRunner;
  import com.intellij.execution.runners.ExecutionEnvironment;
++import com.intellij.execution.runners.ProgramRunner;
  import com.intellij.execution.util.ExecutionErrorDialog;
  import com.intellij.openapi.actionSystem.DataContext;
--import com.intellij.openapi.project.Project;
  import com.intellij.openapi.module.Module;
  import com.intellij.openapi.module.ModuleUtil;
++import com.intellij.openapi.project.Project;
  import com.intellij.openapi.util.text.StringUtil;
  import com.intellij.psi.*;
--import com.intellij.psi.util.PsiTreeUtil;
--import com.intellij.psi.util.PsiClassUtil;
  import com.intellij.psi.search.GlobalSearchScope;
++import com.intellij.psi.util.PsiClassUtil;
++import com.intellij.psi.util.PsiTreeUtil;
  import org.jetbrains.annotations.NotNull;
  import org.jetbrains.annotations.Nullable;
  
index a699861def3e2c83d4aee5a153b5032f86682d45,0b4ddd7f2a0b2817eae8a7c0b8a6ab7d384266d5..0d0c08a6e29f13806a473f78cffdf66949216bdc
   */
  package com.intellij.codeInsight.completion;
  
--import com.intellij.codeInsight.*;
++import com.intellij.codeInsight.AutoPopupController;
++import com.intellij.codeInsight.CodeInsightUtilBase;
++import com.intellij.codeInsight.TailType;
++import com.intellij.codeInsight.TailTypes;
  import com.intellij.codeInsight.lookup.LookupElement;
  import com.intellij.codeInsight.lookup.LookupItem;
  import com.intellij.featureStatistics.FeatureUsageTracker;
index f66231688ff9d077b742a2106e965d86f9fbce81,f63c6fdff819bd8dd6bc3c71460c2058b968a371..e6dffbec02b89c924bb54f0cfa0e1cb0358283bc
@@@ -34,8 -34,8 +34,8 @@@ import com.intellij.find.findUsages.Fin
  import com.intellij.find.findUsages.FindUsagesManager;
  import com.intellij.find.findUsages.FindUsagesOptions;
  import com.intellij.find.impl.FindManagerImpl;
--import com.intellij.ide.util.SuperMethodWarningUtil;
  import com.intellij.ide.DataManager;
++import com.intellij.ide.util.SuperMethodWarningUtil;
  import com.intellij.openapi.application.ApplicationManager;
  import com.intellij.openapi.command.undo.UndoUtil;
  import com.intellij.openapi.editor.Editor;
index f802d1a323f188962f9028d9e483e8b2997adc32,404cfdd98054ee9da03c1327c5a2684d09494c14..73f2dcf1f3722211df7cc9197b256b16996925db
   */
  package com.intellij.codeInsight.daemon.impl.quickfix;
  
 -import com.intellij.codeInsight.*;
 -import com.intellij.codeInsight.daemon.*;
 -import com.intellij.codeInsight.intention.*;
 -import com.intellij.openapi.diagnostic.*;
 -import com.intellij.openapi.editor.*;
 -import com.intellij.openapi.project.*;
 +import com.intellij.codeInsight.CodeInsightUtilBase;
 +import com.intellij.codeInsight.daemon.QuickFixBundle;
 +import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
 +import com.intellij.openapi.diagnostic.Logger;
 +import com.intellij.openapi.editor.Editor;
 +import com.intellij.openapi.project.Project;
  import com.intellij.psi.*;
  import com.intellij.psi.controlFlow.*;
 -import com.intellij.psi.util.*;
 -import com.intellij.util.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.psi.util.PsiTreeUtil;
 +import com.intellij.util.IncorrectOperationException;
- import org.jetbrains.annotations.Nullable;
 +import org.jetbrains.annotations.NotNull;
  
  /**
   * @author ven
index a36af7a8ce590b467091a138aea191492245b704,5e56e77d8dc6e22c4c50113731e2dad2a811458e..c8e21c39d88667b5525dd4757387f90905ee2d44
   */
  package com.intellij.codeInsight.intention.impl;
  
 -import com.intellij.codeInsight.intention.*;
 -import com.intellij.openapi.editor.*;
 -import com.intellij.openapi.project.*;
 +import com.intellij.codeInsight.intention.AddAnnotationFix;
 +import com.intellij.openapi.editor.Editor;
 +import com.intellij.openapi.project.Project;
  import com.intellij.psi.*;
 -import org.jetbrains.annotations.*;
 +import org.jetbrains.annotations.NotNull;
- import org.jetbrains.annotations.Nullable;
  
  public class AddDeprecationAnnotationFix extends AddAnnotationFix {
    public AddDeprecationAnnotationFix() {
index 439c856265d242ed03e0d54fb6d716a40fd5bfa0,e4d251f00d5456a0374ff6e26c9f8de3f6dd3c8d..d3a7edf01d3b879d5722c7cf1f5180fd478dd0cd
   */
  package com.intellij.codeInsight.intention.impl;
  
 -import com.intellij.codeInsight.*;
 -import com.intellij.codeInsight.intention.*;
 -import com.intellij.openapi.editor.*;
 -import com.intellij.openapi.project.*;
 +import com.intellij.codeInsight.AnnotationUtil;
 +import com.intellij.codeInsight.intention.AddAnnotationFix;
 +import com.intellij.openapi.editor.Editor;
 +import com.intellij.openapi.project.Project;
  import com.intellij.psi.*;
 -import org.jetbrains.annotations.*;
 +import org.jetbrains.annotations.NotNull;
- import org.jetbrains.annotations.Nullable;
  
  public class AddNullableNotNullAnnotationFix extends AddAnnotationFix {
    public AddNullableNotNullAnnotationFix(final String annotation, final String annotationToRemove) {
index 0648224cfe9c19fca008dbc998fab76e14d40c2d,670798b00dc0bbc822a6e5a8f3a0f8c09df626dd..f06162932d0e041a8d7f9acd36c6ede75d3461d3
   */
  package com.intellij.codeInsight.intention.impl;
  
 -import com.intellij.codeInsight.*;
 -import com.intellij.codeInsight.highlighting.*;
 -import com.intellij.codeInsight.intention.*;
 -import com.intellij.openapi.diagnostic.*;
 -import com.intellij.openapi.editor.*;
 -import com.intellij.openapi.editor.colors.*;
 -import com.intellij.openapi.project.*;
 +import com.intellij.codeInsight.CodeInsightBundle;
 +import com.intellij.codeInsight.CodeInsightUtilBase;
 +import com.intellij.codeInsight.highlighting.HighlightManager;
 +import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
 +import com.intellij.openapi.diagnostic.Logger;
 +import com.intellij.openapi.editor.Editor;
 +import com.intellij.openapi.editor.colors.EditorColors;
 +import com.intellij.openapi.editor.colors.EditorColorsManager;
 +import com.intellij.openapi.project.Project;
  import com.intellij.psi.*;
 -import com.intellij.psi.util.*;
 -import com.intellij.util.*;
 -import gnu.trove.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.psi.util.PsiTreeUtil;
 +import com.intellij.psi.util.PsiUtil;
 +import com.intellij.util.IncorrectOperationException;
 +import gnu.trove.TIntArrayList;
 +import gnu.trove.TIntProcedure;
 +import org.jetbrains.annotations.NotNull;
- import org.jetbrains.annotations.Nullable;
  
  /**
   * @author ven
index 246a4825d81630b0146340ed6a05b5a3aace75f9,2d36ed2489ce67923ca40281c4d9395bf52ffa17..5fc72da94f040881eb9e1512a2abe01a15b97435
   */
  package com.intellij.codeInsight.intention.impl;
  
 -import com.intellij.codeInsight.*;
 -import com.intellij.codeInsight.intention.*;
 -import com.intellij.openapi.diagnostic.*;
 -import com.intellij.openapi.editor.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.util.*;
 +import com.intellij.codeInsight.CodeInsightBundle;
 +import com.intellij.codeInsight.CodeInsightUtilBase;
 +import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
 +import com.intellij.openapi.diagnostic.Logger;
 +import com.intellij.openapi.editor.Editor;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.util.Key;
  import com.intellij.psi.*;
 -import com.intellij.psi.impl.source.tree.java.*;
 -import com.intellij.psi.util.*;
 -import com.intellij.util.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl;
 +import com.intellij.psi.util.PsiTreeUtil;
 +import com.intellij.psi.util.PsiUtil;
 +import com.intellij.util.IncorrectOperationException;
 +import org.jetbrains.annotations.NotNull;
- import org.jetbrains.annotations.Nullable;
  
  public class AddSingleMemberStaticImportAction extends PsiElementBaseIntentionAction {
    private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.intention.impl.AddSingleMemberStaticImportAction");
index 85ffa6e435a8743ae791404135debed6a8f69e7f,4d31a536726e12728e1d26bbaeeb61266c6f7172..606b9acef5385a2aeb5e0eea88a3547bec97f1ed
   */
  package com.intellij.codeInsight.intention.impl;
  
 -import com.intellij.codeInsight.*;
 -import com.intellij.codeInsight.intention.*;
 -import com.intellij.openapi.editor.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.patterns.*;
 +import com.intellij.codeInsight.CodeInsightBundle;
 +import com.intellij.codeInsight.CodeInsightUtilBase;
 +import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
 +import com.intellij.openapi.editor.Editor;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.patterns.PlatformPatterns;
  import com.intellij.psi.*;
 -import com.intellij.psi.codeStyle.*;
 -import com.intellij.psi.util.*;
 -import com.intellij.ui.*;
 -import com.intellij.util.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.psi.codeStyle.CodeStyleManager;
 +import com.intellij.psi.util.PsiTreeUtil;
 +import com.intellij.ui.ColorChooser;
 +import com.intellij.util.IncorrectOperationException;
 +import org.jetbrains.annotations.NotNull;
- import org.jetbrains.annotations.Nullable;
  
  import java.awt.*;
  
index e6260790cf0ca46e15b17cd3df9e372962efa263,de8a46a551a4ecda4d54a75ac0d2e3d4cd2ab767..9e98454ef5e5ef2cf3634ed5d1b952d5b781a41c
   */
  package com.intellij.codeInsight.intention.impl;
  
 -import com.intellij.codeInsight.*;
 -import com.intellij.codeInsight.intention.*;
 -import com.intellij.openapi.diagnostic.*;
 -import com.intellij.openapi.editor.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.util.*;
 +import com.intellij.codeInsight.CodeInsightBundle;
 +import com.intellij.codeInsight.CodeInsightServicesUtil;
 +import com.intellij.codeInsight.CodeInsightUtilBase;
 +import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
 +import com.intellij.openapi.diagnostic.Logger;
 +import com.intellij.openapi.editor.Editor;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.util.TextRange;
  import com.intellij.psi.*;
 -import com.intellij.psi.codeStyle.*;
 +import com.intellij.psi.codeStyle.CodeStyleManager;
  import com.intellij.psi.controlFlow.*;
 -import com.intellij.psi.util.*;
 -import com.intellij.util.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.psi.util.PsiTreeUtil;
 +import com.intellij.util.IncorrectOperationException;
 +import org.jetbrains.annotations.NotNull;
- import org.jetbrains.annotations.Nullable;
  
 -import java.util.*;
 +import java.util.List;
  
  public class InvertIfConditionAction extends PsiElementBaseIntentionAction {
    private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.intention.impl.InvertIfConditionAction");
index c57987dea9ba7d08c0e8ae9b700ceef38fc628ef,b14c6a53f4a6a3ad19301b3579fa1858c8ee4f59..4301a17efae989fc0c0dcb5eae539c5e8e3fa61b
   */
  package com.intellij.codeInsight.intention.impl;
  
 -import com.intellij.codeInsight.*;
 -import com.intellij.codeInsight.daemon.impl.analysis.*;
 -import com.intellij.codeInsight.daemon.impl.quickfix.*;
 -import com.intellij.codeInsight.highlighting.*;
 -import com.intellij.codeInsight.intention.*;
 -import com.intellij.openapi.editor.*;
 -import com.intellij.openapi.editor.colors.*;
 -import com.intellij.openapi.editor.markup.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.util.*;
 +import com.intellij.codeInsight.CodeInsightBundle;
 +import com.intellij.codeInsight.CodeInsightUtilBase;
 +import com.intellij.codeInsight.daemon.impl.analysis.HighlightControlFlowUtil;
 +import com.intellij.codeInsight.daemon.impl.analysis.HighlightUtil;
 +import com.intellij.codeInsight.daemon.impl.quickfix.CreateFromUsageUtils;
 +import com.intellij.codeInsight.highlighting.HighlightManager;
 +import com.intellij.codeInsight.intention.IntentionAction;
 +import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
 +import com.intellij.codeInsight.intention.QuickFixFactory;
 +import com.intellij.openapi.editor.Editor;
 +import com.intellij.openapi.editor.colors.EditorColors;
 +import com.intellij.openapi.editor.colors.EditorColorsManager;
 +import com.intellij.openapi.editor.markup.TextAttributes;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.util.Ref;
  import com.intellij.psi.*;
 -import com.intellij.psi.impl.source.jsp.jspJava.*;
 -import com.intellij.psi.javadoc.*;
 -import com.intellij.psi.util.*;
 -import com.intellij.util.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.psi.impl.source.jsp.jspJava.JspClass;
 +import com.intellij.psi.javadoc.PsiDocComment;
 +import com.intellij.psi.util.PsiTreeUtil;
 +import com.intellij.util.IncorrectOperationException;
 +import org.jetbrains.annotations.NotNull;
- import org.jetbrains.annotations.Nullable;
  
  import java.util.*;
  
index b9734e6ddb34def6c8df997c75634ec4953864c9,def977c63ca28b825f0a875dc3e43087e3aa1068..7bf2d1351267628aa20ede9a4231dea788495374
   */
  package com.intellij.codeInsight.intention.impl;
  
 -import com.intellij.codeInsight.*;
 -import com.intellij.codeInsight.intention.*;
 -import com.intellij.openapi.editor.*;
 -import com.intellij.openapi.project.*;
 +import com.intellij.codeInsight.CodeInsightBundle;
 +import com.intellij.codeInsight.CodeInsightUtilBase;
 +import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
 +import com.intellij.openapi.editor.Editor;
 +import com.intellij.openapi.project.Project;
  import com.intellij.psi.*;
 -import com.intellij.psi.codeStyle.*;
 -import com.intellij.psi.javadoc.*;
 -import com.intellij.psi.util.*;
 -import com.intellij.util.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.psi.codeStyle.CodeStyleManager;
 +import com.intellij.psi.javadoc.PsiDocComment;
 +import com.intellij.psi.util.PsiTreeUtil;
 +import com.intellij.util.IncorrectOperationException;
 +import org.jetbrains.annotations.NotNull;
- import org.jetbrains.annotations.Nullable;
  
  /**
   * @author max
index f4552a406c03c101ca501ca05fb943dddee4119b,63b6cc80aab7d9c4a4fc4e26998571b2719747aa..b62a5aebd2926b7925ef32f21b9f9a18a45710da
   */
  package com.intellij.codeInsight.intention.impl;
  
 -import com.intellij.codeInsight.*;
 -import com.intellij.codeInsight.intention.*;
 -import com.intellij.openapi.diagnostic.*;
 -import com.intellij.openapi.editor.*;
 -import com.intellij.openapi.project.*;
 +import com.intellij.codeInsight.CodeInsightBundle;
 +import com.intellij.codeInsight.CodeInsightUtilBase;
 +import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
 +import com.intellij.openapi.diagnostic.Logger;
 +import com.intellij.openapi.editor.Editor;
 +import com.intellij.openapi.editor.ScrollType;
 +import com.intellij.openapi.project.Project;
  import com.intellij.psi.*;
 -import com.intellij.psi.codeStyle.*;
 -import com.intellij.psi.util.*;
 -import com.intellij.util.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.psi.codeStyle.CodeStyleManager;
 +import com.intellij.psi.util.PsiTreeUtil;
 +import com.intellij.util.IncorrectOperationException;
 +import org.jetbrains.annotations.NotNull;
- import org.jetbrains.annotations.Nullable;
  
  /**
   * @author mike
index 546b6f4606c961e8f7a0bb36198e7e7dbd1c867c,bb27d8b637fb5c7a63e87e3fb3b8797254f53154..8a983be67fa202c46c45f2bb5f211d7d9bbdfe2d
@@@ -48,8 -48,8 +48,8 @@@ import com.intellij.refactoring.Refacto
  import com.intellij.refactoring.extractMethod.InputVariables;
  import com.intellij.refactoring.util.CommonRefactoringUtil;
  import com.intellij.refactoring.util.RefactoringUtil;
--import com.intellij.util.VisibilityUtil;
  import com.intellij.util.IncorrectOperationException;
++import com.intellij.util.VisibilityUtil;
  import org.jetbrains.annotations.NonNls;
  import org.jetbrains.annotations.NotNull;
  
index 0000000000000000000000000000000000000000,581682b6b9a239ad785ce652f6f60455978d4066..fafcde38fb92221477d817774a2936e904755c7c
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,11 +1,11 @@@
 -import java.util.*;
++import java.util.Collection;
+ class Test {
+   void foo() {
+     final Collection<? extends Number> extensions = getExtensions();
+     for (Number extension : exte<caret>nsions) {
+     }
+   }
+   Collection<? extends Number> getExtensions() {return null;}
+ }
index 0000000000000000000000000000000000000000,5f181011663ecb580ec1cb9c618817ab848e7cb7..9e143ca9b04d66940ab8e0ad7c63c2bffc20b4d3
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,126 +1,129 @@@
 -import java.util.*;
+ /*
+  * Copyright 2000-2010 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.
+  */
+ /*
+  * User: anna
+  * Date: 02-Jun-2010
+  */
+ package com.intellij.refactoring;
+ import com.intellij.openapi.fileEditor.FileDocumentManager;
+ import com.intellij.openapi.vfs.LocalFileSystem;
+ import com.intellij.openapi.vfs.VirtualFile;
+ import com.intellij.psi.*;
+ import com.intellij.psi.search.GlobalSearchScope;
+ import com.intellij.refactoring.extractclass.ExtractClassProcessor;
+ import com.intellij.refactoring.util.classMembers.MemberInfo;
+ import junit.framework.Assert;
++import java.util.ArrayList;
++import java.util.Arrays;
++import java.util.List;
++import java.util.TreeSet;
+ public class ExtractEnumTest extends MultiFileTestCase {
+   @Override
+   protected String getTestRoot() {
+     return "/refactoring/extractEnum/";
+   }
+   public void testOneConstant() throws Exception {
+     doTest(new RefactoringTestUtil.MemberDescriptor("FOO", PsiField.class, true));
+   }
+   public void testDependantConstants() throws Exception {
+     doTest(new RefactoringTestUtil.MemberDescriptor("FOO", PsiField.class, true),
+            new RefactoringTestUtil.MemberDescriptor("BAR", PsiField.class, true));
+   }
+   public void testReferencesOnEnumConstantInEnum() throws Exception {
+     doTest(new RefactoringTestUtil.MemberDescriptor("FOO", PsiField.class, true),
+            new RefactoringTestUtil.MemberDescriptor("foo", PsiMethod.class));
+   }
+   public void testReferencesOnEnumConstantInOriginal() throws Exception {
+     doTest(new RefactoringTestUtil.MemberDescriptor("FOO", PsiField.class, true));
+   }
+   public void testForwardReferenceConflict() throws Exception {
+     doTest("Enum constant field <b><code>BAR</code></b> would forward reference on field field <b><code>FOO</code></b>", false,
+            new RefactoringTestUtil.MemberDescriptor("FOO", PsiField.class, false),
+            new RefactoringTestUtil.MemberDescriptor("BAR", PsiField.class, true));
+   }
+   public void testValueNameConflict() throws Exception {
+     doTest(new RefactoringTestUtil.MemberDescriptor("FOO", PsiField.class, true),
+            new RefactoringTestUtil.MemberDescriptor("value", PsiField.class, false));
+   }
+   private void doTest(final RefactoringTestUtil.MemberDescriptor... memberDescriptors) throws Exception {
+     doTest(null, false, memberDescriptors);
+   }
+   private void doTest(final String conflicts,
+                       final boolean generateAccessors,
+                       final RefactoringTestUtil.MemberDescriptor... memberDescriptors) throws Exception {
+     doTest(new PerformAction() {
+       public void performAction(VirtualFile rootDir, VirtualFile rootAfter) throws Exception {
+         final PsiClass aClass = myJavaFacade.findClass("Test", GlobalSearchScope.projectScope(myProject));
+         assertNotNull("Class Test not found", aClass);
+         final ArrayList<PsiField> fields = new ArrayList<PsiField>();
+         final ArrayList<PsiMethod> methods = new ArrayList<PsiMethod>();
+         final List<MemberInfo> enumConstants = new ArrayList<MemberInfo>();
+         for (MemberInfo memberInfo : RefactoringTestUtil.findMembers(aClass, memberDescriptors)) {
+           final PsiMember member = memberInfo.getMember();
+           if (member instanceof PsiField) {
+             fields.add((PsiField)member);
+             if (member.hasModifierProperty(PsiModifier.STATIC) && member.hasModifierProperty(PsiModifier.FINAL) && ((PsiField)member).hasInitializer()) {
+               if (memberInfo.isToAbstract()) {
+                 enumConstants.add(memberInfo);
+               }
+             }
+           }
+           else if (member instanceof PsiMethod) {
+             methods.add((PsiMethod)member);
+           }
+         }
+         try {
+           final ExtractClassProcessor processor =
+             new ExtractClassProcessor(aClass, fields, methods, new ArrayList<PsiClass>(), "", "EEnum",
+                                       null, generateAccessors, enumConstants);
+           processor.run();
+           LocalFileSystem.getInstance().refresh(false);
+           FileDocumentManager.getInstance().saveAllDocuments();
+         }
+         catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
+           if (conflicts != null) {
+             TreeSet expectedConflictsSet = new TreeSet(Arrays.asList(conflicts.split("\n")));
+             TreeSet actualConflictsSet = new TreeSet(Arrays.asList(e.getMessage().split("\n")));
+             Assert.assertEquals(expectedConflictsSet, actualConflictsSet);
+             return;
+           }
+           else {
+             fail(e.getMessage());
+           }
+         }
+         if (conflicts != null) {
+           fail("Conflicts were not detected: " + conflicts);
+         }
+       }
+     });
+   }
+ }
index 4d95425778a57032159f7720bf4213632f2c1d03,1a08474e4d56cebf4feefb48ce06082bd4730003..55813fb2b5026d95d53cbb2c523188e9cd8d5b72
@@@ -1,5 -1,5 +1,6 @@@
  package com.intellij.refactoring;
  
++import com.intellij.JavaTestUtil;
  import com.intellij.codeInsight.CodeInsightUtil;
  import com.intellij.openapi.editor.Editor;
  import com.intellij.openapi.project.Project;
@@@ -15,7 -15,7 +16,6 @@@ import com.intellij.refactoring.extract
  import com.intellij.refactoring.util.duplicates.Match;
  import com.intellij.testFramework.LightCodeInsightTestCase;
  import com.intellij.util.IncorrectOperationException;
--import com.intellij.JavaTestUtil;
  import org.jetbrains.annotations.NonNls;
  
  import java.util.List;
index 2048ed9afe39be104b3fde2ec9b00308cd164c92,4f7580b5fa34d7cd7ad1fe53977b5d67216bf710..56fefe62646fcf08ec6e084ca5afa6112e147dfb
@@@ -1,10 -1,12 +1,12 @@@
  package com.intellij.refactoring;
  
++import com.intellij.JavaTestUtil;
+ import com.intellij.openapi.projectRoots.Sdk;
+ import com.intellij.openapi.projectRoots.impl.JavaSdkImpl;
  import com.intellij.psi.PsiPrimitiveType;
  import com.intellij.psi.PsiType;
  import com.intellij.refactoring.introduceField.BaseExpressionToFieldHandler;
  import com.intellij.testFramework.LightCodeInsightTestCase;
--import com.intellij.JavaTestUtil;
  
  /**
   * @author ven
index 2643b518c1d166e59a7e30ff73d5d341632e6c1c,e6f4d814c019904ed69734ce80395a5543fc030f..c99b894f6bd1cd17c3ee50b0f5953a34e24e6544
@@@ -4,6 -4,6 +4,7 @@@
   */
  package com.intellij.refactoring;
  
++import com.intellij.JavaTestUtil;
  import com.intellij.openapi.fileEditor.FileDocumentManager;
  import com.intellij.openapi.vfs.LocalFileSystem;
  import com.intellij.openapi.vfs.VirtualFile;
@@@ -13,7 -13,7 +14,6 @@@ import com.intellij.psi.search.GlobalSe
  import com.intellij.refactoring.replaceConstructorWithBuilder.ParameterData;
  import com.intellij.refactoring.replaceConstructorWithBuilder.ReplaceConstructorWithBuilderProcessor;
  import com.intellij.util.containers.HashMap;
--import com.intellij.JavaTestUtil;
  
  import java.util.LinkedHashMap;
  import java.util.Map;
index 131268d5153c662c79afbec290f28db9815f9388,7fc000e917d541b3a58d488602901da9d516974d..bbf73ecb7854ac00bc6c1ff88dd9f6068c00e18a
  
  package com.intellij.execution.junit;
  
--import com.intellij.execution.*;
++import com.intellij.execution.Location;
++import com.intellij.execution.PsiLocation;
++import com.intellij.execution.RunManager;
++import com.intellij.execution.RunnerAndConfigurationSettings;
  import com.intellij.execution.actions.ConfigurationContext;
  import com.intellij.execution.configurations.ConfigurationFactory;
  import com.intellij.execution.configurations.ConfigurationType;
index 292405449be98226978b17462403e614e114ca6a,979da8f2fb4a5d809b887ad003fec21d16d91c14..653553799c9f918f580c23e657a6508712503ca6
@@@ -22,8 -22,8 +22,8 @@@ import com.intellij.openapi.actionSyste
  import com.intellij.openapi.diagnostic.Logger;
  import com.intellij.openapi.extensions.Extensions;
  import com.intellij.openapi.project.DumbAware;
--import com.intellij.openapi.project.Project;
  import com.intellij.openapi.project.DumbService;
++import com.intellij.openapi.project.Project;
  import com.intellij.util.containers.HashMap;
  import com.intellij.util.containers.HashSet;
  import org.jetbrains.annotations.NonNls;
index 4ef72efee8f10d28c7b5d867c315daa9e984b33c,f20e30937280319be63be9fb443ee44c9cb0b94f..81f00caee222d39efb22f08de84661d16f3f7019
@@@ -18,8 -18,8 +18,8 @@@ package com.intellij.execution.actions
  
  import com.intellij.execution.*;
  import com.intellij.execution.configurations.RunConfiguration;
--import com.intellij.execution.runners.ProgramRunner;
  import com.intellij.execution.runners.ExecutionEnvironment;
++import com.intellij.execution.runners.ProgramRunner;
  import com.intellij.openapi.actionSystem.Presentation;
  import com.intellij.openapi.ui.Messages;
  import org.jetbrains.annotations.NotNull;
index e130a4063275b350d69a7491c2588af42d53f6cd,a5c5174a029cb27de0a8667d44754f9078f782b6..53de302b4f2a51e739e102bbf9f2f16ac91743b5
@@@ -39,8 -39,8 +39,10 @@@ import javax.swing.*
  import java.awt.*;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
--import java.util.*;
++import java.util.ArrayList;
++import java.util.Collections;
  import java.util.List;
++import java.util.Map;
  
  /**
   * User: anna
index fa62d357ea01af5af03f93c45912129e9dc33943,6f4786b789f2f4c6d01fc1b66931b28d5d28eae1..d2e407efbd2cc13c677e76a41b1e5ae1df162644
@@@ -31,7 -31,7 +31,10 @@@ import com.intellij.openapi.options.ex.
  import com.intellij.openapi.project.Project;
  import com.intellij.openapi.ui.Messages;
  import com.intellij.openapi.ui.Splitter;
--import com.intellij.openapi.ui.popup.*;
++import com.intellij.openapi.ui.popup.JBPopupFactory;
++import com.intellij.openapi.ui.popup.ListPopup;
++import com.intellij.openapi.ui.popup.ListPopupStep;
++import com.intellij.openapi.ui.popup.PopupStep;
  import com.intellij.openapi.ui.popup.util.BaseListPopupStep;
  import com.intellij.openapi.util.Comparing;
  import com.intellij.openapi.util.IconLoader;
index 9da838b8559e70060cc96e564108c5824b55e4a1,bfea825bf9b6152230f4ab0eb0f5cffc8d888354..53dfcb601fd82648fbb9709a8e00693b2c7f4eb9
@@@ -12,9 -12,10 +12,9 @@@ import com.intellij.execution.process.P
  import com.intellij.execution.process.ProcessOutputTypes;
  import com.intellij.execution.runners.DefaultProgramRunner;
  import com.intellij.execution.runners.ProgramRunner;
--import com.intellij.openapi.application.ApplicationManager;
+ import com.intellij.openapi.application.ex.ApplicationManagerEx;
+ import com.intellij.openapi.diagnostic.Logger;
  import com.intellij.openapi.progress.ProgressManager;
- import com.intellij.openapi.project.Project;
  import com.intellij.openapi.util.Key;
  import com.intellij.openapi.util.Pair;
  import com.intellij.openapi.util.Ref;
index 62c157186e1d16bbc5cd5895efac64e851db839b,a18530f8c0ee82ce58729ad3e83f4f0f5ed86cde..0001499173ccba31188d39388288d26187eb46ce
@@@ -40,9 -40,7 +40,10 @@@ import javax.swing.tree.DefaultMutableT
  import javax.swing.tree.DefaultTreeModel;
  import javax.swing.tree.TreeNode;
  import javax.swing.tree.TreePath;
 -import java.util.*;
 +import java.util.ArrayList;
++import java.util.Arrays;
 +import java.util.Comparator;
 +import java.util.List;
  
  public abstract class BaseProjectTreeBuilder extends AbstractTreeBuilder {
    protected final Project myProject;
index 4906d0a85439a7aedd7d965612586fbc83b41142,bd9f6ea921eb0584a18a1a0bf00efbc4bde97c42..ae554b56c0530a912ea6384e5abc91ab6393d1ef
@@@ -32,10 -34,10 +34,9 @@@ import com.intellij.psi.PsiFile
  import com.intellij.psi.PsiManager;
  import com.intellij.refactoring.RefactoringBundle;
  import com.intellij.refactoring.util.CommonRefactoringUtil;
- import com.intellij.ui.EditorComboBox;
- import com.intellij.ui.EditorComboWithBrowseButton;
+ import com.intellij.ui.DocumentAdapter;
  import com.intellij.ui.IdeBorderFactory;
--import com.intellij.ui.RecentsManager;
+ import com.intellij.ui.TextFieldWithStoredHistory;
  import com.intellij.util.IncorrectOperationException;
  import org.jetbrains.annotations.NonNls;
  
index 1190f882346aff9ee2af43ad0f09c4c89fb28245,897acdb0ba9d12e62b4c444793353ab65c89a15a..b0ab02fd1bfba796bf539b2ad3aa6d77f859f37c
@@@ -23,7 -23,8 +23,7 @@@ import com.intellij.openapi.application
  import com.intellij.openapi.progress.ProgressIndicator;
  import com.intellij.openapi.progress.Progressive;
  import com.intellij.openapi.util.ActionCallback;
- import com.intellij.openapi.util.registry.Registry;
+ import com.intellij.openapi.util.AsyncResult;
 -import com.intellij.openapi.util.registry.Registry;
  import com.intellij.util.containers.HashSet;
  import com.intellij.util.ui.UIUtil;
  import com.intellij.util.ui.update.MergingUpdateQueue;
index 9b8736df343db9d452ae868079d9106a123fe076,205369d8a8b11b91b72660dba812e5e02bf8870b..9694bcc20b5fd12d53794fe1410cc9f0abfcbf0c
@@@ -26,8 -27,8 +27,8 @@@ import org.jetbrains.annotations.NotNul
  import javax.swing.*;
  import java.awt.*;
  import java.awt.event.ActionEvent;
--import java.awt.event.KeyEvent;
  import java.awt.event.InputEvent;
++import java.awt.event.KeyEvent;
  
  public class ListScrollingUtil {
    private static final Logger LOG = Logger.getInstance("#com.intellij.ui.ListScrollingUtil");
index 0c83e7090cf688a4aff6371ce55bb548eded127d,dde5ca627468ebea5ae53c45731af139b5626d0d..3760b008a4396352baa035263a85cc237fb3b41a
   */
  package com.intellij.notification.impl;
  
 -import com.intellij.ide.*;
 -import com.intellij.notification.*;
 -import com.intellij.notification.impl.ui.*;
 -import com.intellij.openapi.actionSystem.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.ui.popup.*;
 -import com.intellij.openapi.util.*;
 -import com.intellij.openapi.wm.*;
 -import com.intellij.util.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.ide.DataManager;
 +import com.intellij.notification.Notification;
 +import com.intellij.notification.NotificationType;
 +import com.intellij.notification.impl.ui.NotificationsListPanel;
 +import com.intellij.openapi.actionSystem.PlatformDataKeys;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.ui.popup.JBPopup;
 +import com.intellij.openapi.util.IconLoader;
- import com.intellij.openapi.wm.StatusBarWidget;
 +import com.intellij.openapi.wm.StatusBar;
++import com.intellij.openapi.wm.StatusBarWidget;
 +import com.intellij.util.Consumer;
 +import org.jetbrains.annotations.NotNull;
 +import org.jetbrains.annotations.Nullable;
  
  import javax.swing.*;
  import java.awt.*;
index 2f3e2062cac55de3ec08845976c309f7d70a6657,2920f3cdb7f00487307fd561c0e24666137fd1b1..517b458485e4f6a61914ff9ac8c94067207355c8
   */
  package com.intellij.notification.impl;
  
- import com.intellij.notification.Notifications;
 -import com.intellij.notification.*;
 -import com.intellij.openapi.*;
 -import com.intellij.openapi.application.*;
 -import com.intellij.openapi.components.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.ui.popup.*;
 -import com.intellij.openapi.util.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.notification.Notification;
 +import com.intellij.notification.NotificationDisplayType;
++import com.intellij.notification.Notifications;
++import com.intellij.openapi.Disposable;
 +import com.intellij.openapi.application.Application;
 +import com.intellij.openapi.application.ApplicationManager;
 +import com.intellij.openapi.components.ProjectComponent;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.ui.popup.Balloon;
 +import com.intellij.openapi.util.Disposer;
- import com.intellij.openapi.Disposable;
 +import org.jetbrains.annotations.NotNull;
  
 -import java.util.*;
 +import java.util.Collection;
  
  /**
   * @author spleaner
index 80e7c6a9bf2d7d37babfd709868def2b643a47b8,2fe3bdf3d4fa9aadb58dc90fb78e2249e9e73bd5..a5ac724fa76d359adf4d2dd80d7dee9c4cd6c795
@@@ -22,9 -22,10 +22,13 @@@ import com.intellij.openapi.components.
  import com.intellij.openapi.editor.Document;
  import com.intellij.openapi.fileEditor.FileDocumentManager;
  import com.intellij.openapi.util.Key;
--import com.intellij.openapi.vfs.*;
++import com.intellij.openapi.vfs.VirtualFile;
++import com.intellij.openapi.vfs.VirtualFileAdapter;
++import com.intellij.openapi.vfs.VirtualFileEvent;
++import com.intellij.openapi.vfs.VirtualFileManager;
  import com.intellij.openapi.vfs.newvfs.NewVirtualFile;
  import com.intellij.util.containers.WeakValueHashMap;
+ import com.intellij.util.io.fs.FilePath;
  import org.jetbrains.annotations.NotNull;
  
  import java.lang.ref.Reference;
index 19ee284dc689c579fcd50f2708a0ea0298df6c44,96e11e646bc0201be36fb5a38e00c5b5cbc2f10f..e94bf582ad5dbc1b4298ebbb99c73470a3921ea5
@@@ -39,7 -39,7 +39,10 @@@ import java.awt.event.InputEvent
  import java.awt.event.KeyEvent;
  import java.awt.event.MouseEvent;
  import java.lang.reflect.Field;
--import java.util.*;
++import java.util.ArrayList;
++import java.util.Arrays;
++import java.util.List;
++import java.util.Map;
  
  /**
   * @author Eugene Belyaev
index 874cb318001ce365d025a80ba6b8d554cc5efdaa,b4d0879f55b0dfc36dadfb27683bb4bcf38663ad..b82168df8c62336a17b707e3c05880459ac2a6aa
   */
  package com.intellij.openapi.wm.impl;
  
 -import com.intellij.ide.*;
 +import com.intellij.ide.AppLifecycleListener;
 +import com.intellij.ide.DataManager;
  import com.intellij.ide.impl.ProjectUtil;
 -import com.intellij.ide.ui.*;
 -import com.intellij.openapi.*;
 -import com.intellij.openapi.actionSystem.*;
 -import com.intellij.openapi.application.*;
 -import com.intellij.openapi.application.ex.*;
 -import com.intellij.openapi.keymap.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.util.*;
 -import com.intellij.openapi.util.registry.*;
 -import com.intellij.openapi.wm.*;
 -import com.intellij.openapi.wm.ex.*;
 -import com.intellij.openapi.wm.impl.status.*;
 -import com.intellij.ui.*;
 -import com.intellij.util.ui.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.ide.ui.UISettings;
 +import com.intellij.openapi.Disposable;
 +import com.intellij.openapi.MnemonicHelper;
 +import com.intellij.openapi.actionSystem.ActionManager;
 +import com.intellij.openapi.actionSystem.DataProvider;
 +import com.intellij.openapi.actionSystem.PlatformDataKeys;
 +import com.intellij.openapi.application.Application;
 +import com.intellij.openapi.application.ApplicationInfo;
 +import com.intellij.openapi.application.ApplicationManager;
 +import com.intellij.openapi.application.ModalityState;
 +import com.intellij.openapi.application.ex.ApplicationInfoEx;
 +import com.intellij.openapi.application.ex.ApplicationManagerEx;
 +import com.intellij.openapi.keymap.KeymapManager;
 +import com.intellij.openapi.project.DumbAwareRunnable;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.project.ProjectManager;
 +import com.intellij.openapi.util.Disposer;
 +import com.intellij.openapi.util.SystemInfo;
 +import com.intellij.openapi.util.registry.Registry;
 +import com.intellij.openapi.wm.IdeFrame;
 +import com.intellij.openapi.wm.StatusBar;
 +import com.intellij.openapi.wm.ex.LayoutFocusTraversalPolicyExt;
++import com.intellij.openapi.wm.ex.StatusBarEx;
 +import com.intellij.openapi.wm.impl.status.EncodingPanel;
 +import com.intellij.openapi.wm.impl.status.InsertOverwritePanel;
 +import com.intellij.openapi.wm.impl.status.PositionPanel;
 +import com.intellij.openapi.wm.impl.status.ToggleReadOnlyAttributePanel;
 +import com.intellij.ui.AppUIUtil;
 +import com.intellij.ui.BalloonLayout;
 +import com.intellij.ui.FocusTrackback;
 +import com.intellij.util.ui.UIUtil;
 +import org.jetbrains.annotations.NotNull;
 +import org.jetbrains.annotations.Nullable;
  
  import javax.swing.*;
  import java.awt.*;
index 03efe7f725cd5ceb4f0a37354f2c83e26add6848,93aad7ed8bb41400ed0ddf3b081732699e4aa6ca..869771a037600ffc45ce50246f1b6bafdc70da40
   */
  package com.intellij.openapi.wm.impl.status;
  
 -import com.intellij.openapi.*;
 -import com.intellij.openapi.progress.*;
 -import com.intellij.openapi.ui.*;
 -import com.intellij.openapi.ui.popup.*;
 -import com.intellij.openapi.util.*;
 -import com.intellij.openapi.util.text.*;
 -import com.intellij.openapi.wm.*;
 -import com.intellij.openapi.wm.ex.*;
 -import com.intellij.ui.awt.*;
 -import com.intellij.ui.popup.*;
 -import com.intellij.util.*;
 +import com.intellij.openapi.Disposable;
 +import com.intellij.openapi.progress.TaskInfo;
 +import com.intellij.openapi.ui.MessageType;
 +import com.intellij.openapi.ui.popup.BalloonHandler;
 +import com.intellij.openapi.ui.popup.ListPopup;
 +import com.intellij.openapi.util.Disposer;
 +import com.intellij.openapi.util.IconLoader;
 +import com.intellij.openapi.util.SystemInfo;
 +import com.intellij.openapi.util.text.StringUtil;
 +import com.intellij.openapi.wm.CustomStatusBarWidget;
 +import com.intellij.openapi.wm.StatusBar;
 +import com.intellij.openapi.wm.StatusBarWidget;
 +import com.intellij.openapi.wm.ex.ProgressIndicatorEx;
 +import com.intellij.openapi.wm.ex.StatusBarEx;
 +import com.intellij.ui.awt.RelativePoint;
 +import com.intellij.ui.popup.NotificationPopup;
 +import com.intellij.util.Consumer;
  import com.intellij.util.containers.HashMap;
 -import com.intellij.util.ui.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.util.ui.UIUtil;
 +import org.jetbrains.annotations.NotNull;
 +import org.jetbrains.annotations.Nullable;
  
  import javax.swing.*;
 -import javax.swing.event.*;
 +import javax.swing.event.HyperlinkListener;
  import java.awt.*;
 -import java.awt.event.*;
 +import java.awt.event.MouseAdapter;
 +import java.awt.event.MouseEvent;
++import java.util.ArrayList;
  import java.util.List;
 -import java.util.*;
 +import java.util.Map;
 +import java.util.Random;
  
  /**
   * User: spLeaner
index 3ff85536180c77379d38fd1c5168d340c30213a9,38de0902bb4955a5676da0c6f631dbdbb52e3594..b132a519865b8f03e8c3aa2f617c5dd7671d5314
   */
  package com.intellij.openapi.wm.impl.status;
  
 -import com.intellij.idea.*;
 -import com.intellij.openapi.application.*;
 -import com.intellij.openapi.application.ex.*;
 -import com.intellij.openapi.progress.*;
 -import com.intellij.openapi.progress.impl.*;
 -import com.intellij.openapi.ui.*;
 -import com.intellij.openapi.ui.popup.*;
 -import com.intellij.openapi.util.*;
 -import com.intellij.openapi.wm.*;
 -import com.intellij.openapi.wm.ex.*;
 -import com.intellij.ui.awt.*;
 -import com.intellij.ui.components.labels.*;
 -import com.intellij.ui.components.panels.*;
 -import com.intellij.util.*;
 -import com.intellij.util.ui.*;
 -import com.intellij.util.ui.update.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.idea.ActionsBundle;
 +import com.intellij.openapi.application.ApplicationManager;
 +import com.intellij.openapi.application.ex.ApplicationManagerEx;
 +import com.intellij.openapi.progress.TaskInfo;
 +import com.intellij.openapi.progress.impl.ProgressManagerImpl;
 +import com.intellij.openapi.ui.MessageType;
 +import com.intellij.openapi.ui.popup.Balloon;
 +import com.intellij.openapi.ui.popup.BalloonHandler;
 +import com.intellij.openapi.ui.popup.JBPopupFactory;
 +import com.intellij.openapi.util.MultiValuesMap;
 +import com.intellij.openapi.util.Pair;
 +import com.intellij.openapi.util.SystemInfo;
 +import com.intellij.openapi.wm.CustomStatusBarWidget;
 +import com.intellij.openapi.wm.StatusBar;
 +import com.intellij.openapi.wm.StatusBarWidget;
 +import com.intellij.openapi.wm.ex.ProgressIndicatorEx;
 +import com.intellij.ui.awt.RelativePoint;
 +import com.intellij.ui.components.labels.LinkLabel;
 +import com.intellij.ui.components.labels.LinkListener;
 +import com.intellij.ui.components.panels.Wrapper;
 +import com.intellij.util.Alarm;
 +import com.intellij.util.ui.AbstractLayoutManager;
 +import com.intellij.util.ui.AsyncProcessIcon;
++import com.intellij.util.ui.EmptyIcon;
 +import com.intellij.util.ui.UIUtil;
 +import com.intellij.util.ui.update.MergingUpdateQueue;
 +import com.intellij.util.ui.update.Update;
 +import org.jetbrains.annotations.NotNull;
  
  import javax.swing.*;
 -import javax.swing.border.*;
 -import javax.swing.event.*;
 +import javax.swing.border.EmptyBorder;
 +import javax.swing.event.HyperlinkListener;
  import java.awt.*;
 -import java.awt.event.*;
 -import java.text.*;
 +import java.awt.event.MouseAdapter;
 +import java.awt.event.MouseEvent;
 +import java.text.SimpleDateFormat;
  import java.util.*;
  import java.util.List;
  
index 4d8d2c2fc3a7313c8e177534fadfd2720289c385,c863892114ddc7d66a294645f6fa227c49413e3f..adf3812b3191f2a1dc3b0699cc8be9fad40a445d
   */
  package com.intellij.openapi.wm.impl.status;
  
 -import com.intellij.ide.*;
 -import com.intellij.ide.ui.*;
 -import com.intellij.openapi.*;
 -import com.intellij.openapi.progress.*;
 -import com.intellij.openapi.progress.util.*;
 -import com.intellij.openapi.ui.popup.*;
 -import com.intellij.openapi.util.*;
 -import com.intellij.openapi.wm.impl.content.*;
 -import com.intellij.ui.*;
 -import com.intellij.ui.components.panels.*;
 -import com.intellij.util.ui.*;
 +import com.intellij.ide.IdeBundle;
 +import com.intellij.ide.ui.LafManager;
 +import com.intellij.openapi.Disposable;
 +import com.intellij.openapi.progress.TaskInfo;
 +import com.intellij.openapi.progress.util.ProgressIndicatorBase;
 +import com.intellij.openapi.ui.popup.IconButton;
 +import com.intellij.openapi.util.EmptyRunnable;
 +import com.intellij.openapi.util.IconLoader;
- import com.intellij.openapi.util.SystemInfo;
 +import com.intellij.openapi.wm.impl.content.GraphicsConfig;
 +import com.intellij.ui.InplaceButton;
 +import com.intellij.ui.components.panels.NonOpaquePanel;
 +import com.intellij.ui.components.panels.Wrapper;
 +import com.intellij.util.ui.UIUtil;
  
  import javax.swing.*;
 -import javax.swing.border.*;
 +import javax.swing.border.EmptyBorder;
  import java.awt.*;
 -import java.awt.event.*;
 +import java.awt.event.ActionEvent;
 +import java.awt.event.ActionListener;
 +import java.awt.event.MouseAdapter;
 +import java.awt.event.MouseEvent;
  
  public class InlineProgressIndicator extends ProgressIndicatorBase implements Disposable {
  
index 245b4f224ddeb1810732182a42064cbfed7e5767,cb24d475082260e1d7e65425c88445bbd5160f6a..27a6e4e1104b38a00ecbcadf24760847698dc1fb
   */
  package com.intellij.openapi.wm.impl.status;
  
 -import com.intellij.ide.*;
 -import com.intellij.openapi.actionSystem.*;
 -import com.intellij.openapi.editor.*;
 -import com.intellij.openapi.fileEditor.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.wm.*;
 -import com.intellij.ui.*;
 -import com.intellij.util.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.ide.DataManager;
 +import com.intellij.openapi.actionSystem.PlatformDataKeys;
 +import com.intellij.openapi.editor.Editor;
 +import com.intellij.openapi.fileEditor.FileEditorManager;
 +import com.intellij.openapi.project.Project;
- import com.intellij.openapi.wm.StatusBarWidget;
 +import com.intellij.openapi.wm.StatusBar;
++import com.intellij.openapi.wm.StatusBarWidget;
 +import com.intellij.ui.UIBundle;
 +import com.intellij.util.Consumer;
 +import org.jetbrains.annotations.NotNull;
 +import org.jetbrains.annotations.Nullable;
  
  import java.awt.*;
 -import java.awt.event.*;
 +import java.awt.event.MouseEvent;
  
  /**
   * @author cdr
index 192458eaca015e338d2b18f0f6ddbe463cdf5ca0,3c9f351a0a3c68116150118cf7c66ac19269ee9a..ea9150abb3abd8272817c82400dedb6d0fc19bc3
   */
  package com.intellij.openapi.wm.impl.status;
  
 -import com.intellij.idea.*;
 -import com.intellij.openapi.actionSystem.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.wm.ex.*;
 -import com.intellij.openapi.wm.impl.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.idea.ActionsBundle;
 +import com.intellij.openapi.actionSystem.AnActionEvent;
 +import com.intellij.openapi.actionSystem.ToggleAction;
++import com.intellij.openapi.project.DumbAware;
 +import com.intellij.openapi.wm.ex.StatusBarEx;
 +import com.intellij.openapi.wm.impl.IdeFrameImpl;
- import com.intellij.openapi.project.DumbAware;
 +import org.jetbrains.annotations.Nullable;
  
  import java.awt.*;
  
index 2c00f6862e0d293d2b2ec76b354ff1fcdaeef03e,d2c9905e15854f1c81d4b9ee5db05a6cada8b0a7..6e905a35fc5f84897882c20e1a1ed91e1eb0eab6
   */
  package com.intellij.openapi.wm.impl.status;
  
 -import com.intellij.ide.*;
 -import com.intellij.openapi.actionSystem.*;
 -import com.intellij.openapi.application.*;
 -import com.intellij.openapi.editor.*;
 -import com.intellij.openapi.fileEditor.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.ui.*;
 -import com.intellij.openapi.util.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.openapi.wm.*;
 -import com.intellij.ui.*;
 -import com.intellij.util.*;
 -import com.intellij.util.io.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.ide.DataManager;
 +import com.intellij.openapi.actionSystem.PlatformDataKeys;
 +import com.intellij.openapi.application.ApplicationManager;
 +import com.intellij.openapi.editor.Editor;
 +import com.intellij.openapi.fileEditor.FileDocumentManager;
 +import com.intellij.openapi.fileEditor.FileEditorManager;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.ui.Messages;
 +import com.intellij.openapi.util.IconLoader;
 +import com.intellij.openapi.vfs.VirtualFile;
- import com.intellij.openapi.wm.StatusBarWidget;
 +import com.intellij.openapi.wm.StatusBar;
++import com.intellij.openapi.wm.StatusBarWidget;
 +import com.intellij.ui.UIBundle;
 +import com.intellij.util.Consumer;
 +import com.intellij.util.io.ReadOnlyAttributeUtil;
- import com.intellij.util.ui.EmptyIcon;
 +import org.jetbrains.annotations.NotNull;
 +import org.jetbrains.annotations.Nullable;
  
  import javax.swing.*;
 -import java.awt.event.*;
 -import java.io.*;
 +import java.awt.event.MouseEvent;
 +import java.io.IOException;
  
  public class ToggleReadOnlyAttributePanel implements StatusBarWidget, StatusBarWidget.IconPresentation {
    private static final Icon myLockedIcon = IconLoader.getIcon("/ide/readonly.png");
index c5ed81422547677dd51c784d4b24ebb6c04ac3f3,a388ca31a8da7f53b25d8339a22aec1a65a7bb57..02e58872708b2bfe2cc31eebd3828972f95b62b6
@@@ -3,10 -4,8 +4,7 @@@ import com.intellij.openapi.diagnostic.
  import com.intellij.openapi.progress.ProcessCanceledException;
  import com.intellij.openapi.progress.ProgressIndicator;
  import com.intellij.openapi.progress.Progressive;
- import com.intellij.openapi.util.ActionCallback;
- import com.intellij.openapi.util.Condition;
- import com.intellij.openapi.util.Disposer;
- import com.intellij.openapi.util.Ref;
+ import com.intellij.openapi.util.*;
 -import com.intellij.testFramework.TestLogger;
  import com.intellij.util.Time;
  import com.intellij.util.WaitFor;
  import junit.framework.TestSuite;
index 0000000000000000000000000000000000000000,e42bd16dec6d8ae8bbda1dcda850856e5d8ebf04..512d143f31e2450dc9d2c7f2e62c2b2a27f52eeb
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,56 +1,57 @@@
 -import java.util.*;
+ /*
+  * Copyright 2000-2010 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 com.intellij.openapi.diagnostic;
++import java.util.ArrayList;
++import java.util.List;
+ /**
+  * This is a very primitive fast logging class, primary for race-conditions debugging 
+  */
+ public class Log {
+   private static List<String> myStrings = new ArrayList<String>();
+   private static List<Throwable> myThrowables = new ArrayList<Throwable>();
+   private static Object LOCK = new Object();
+   public static void print(String text) {
+     print(text, false);
+   }
+   public static void print(String text, boolean trace) {
+     synchronized (LOCK) {
+       myStrings.add(text);
+       myThrowables.add(trace ? new Exception() : null);
+     }
+   }
+   public static void flush() {
+     synchronized (LOCK) {
+       for (int i = 0; i < myStrings.size(); i++) {
+         String each = myStrings.get(i);
+         Throwable trace = myThrowables.get(i);
+         System.out.println(each);
+         if (trace != null) {
+           trace.printStackTrace(System.out);
+         }
+       }
+       myStrings.clear();
+       myThrowables.clear();
+     }
+   }
+ }
index e7403bfde54e974c287604632ab523adf5420150,7d88a6c3ed2f71f9b1868c6e9c642e131c239a81..6f09d119233b19f2beacc64fb055c823945c772c
   */
  package com.intellij.util.ui;
  
 -import com.intellij.openapi.*;
 -import com.intellij.openapi.diagnostic.*;
 -import com.intellij.openapi.util.*;
 -import com.intellij.openapi.util.text.*;
 -import com.intellij.ui.*;
 -import com.intellij.util.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.openapi.Disposable;
 +import com.intellij.openapi.diagnostic.Logger;
 +import com.intellij.openapi.util.Disposer;
 +import com.intellij.openapi.util.IconLoader;
 +import com.intellij.openapi.util.Key;
 +import com.intellij.openapi.util.SystemInfo;
 +import com.intellij.openapi.util.text.StringUtil;
 +import com.intellij.ui.SideBorder;
 +import com.intellij.util.ArrayUtil;
 +import com.intellij.util.ReflectionUtil;
 +import org.jetbrains.annotations.NonNls;
 +import org.jetbrains.annotations.NotNull;
 +import org.jetbrains.annotations.Nullable;
 +import org.jetbrains.annotations.TestOnly;
  
  import javax.swing.*;
 -import javax.swing.border.*;
 -import javax.swing.plaf.*;
 -import javax.swing.plaf.basic.*;
 -import javax.swing.text.html.*;
 -import javax.swing.tree.*;
 +import javax.swing.border.Border;
 +import javax.swing.border.LineBorder;
 +import javax.swing.plaf.ProgressBarUI;
 +import javax.swing.plaf.basic.BasicTreeUI;
 +import javax.swing.text.html.HTMLEditorKit;
 +import javax.swing.text.html.StyleSheet;
 +import javax.swing.tree.TreePath;
  import java.awt.*;
  import java.awt.event.*;
 -import java.awt.font.*;
 +import java.awt.font.FontRenderContext;
+ import java.awt.geom.Rectangle2D;
 -import java.lang.reflect.*;
 +import java.lang.reflect.Field;
 +import java.lang.reflect.Method;
  import java.util.*;
  import java.util.List;
 -import java.util.Map;
 -import java.util.concurrent.*;
 -import java.util.regex.*;
 +import java.util.concurrent.BlockingQueue;
 +import java.util.concurrent.LinkedBlockingQueue;
 +import java.util.regex.Pattern;
  
  /**
   * @author max
index e89c7329737a28b37391dc988906912fd2e02322,3673a5671e09636ea0031cfebd6b32694bbf728d..e86275063b7890ff2fa58354671e22d8317a6ca9
@@@ -32,17 -32,17 +32,17 @@@ import com.intellij.openapi.util.Factor
  import com.intellij.openapi.util.text.StringUtil;
  import com.intellij.patterns.PsiJavaPatterns;
  import com.intellij.psi.*;
--import com.intellij.psi.search.GlobalSearchScope;
  import com.intellij.psi.codeStyle.JavaCodeStyleManager;
++import com.intellij.psi.search.GlobalSearchScope;
  import com.intellij.psi.util.PsiTreeUtil;
  import com.intellij.psi.util.PsiUtil;
++import com.intellij.ui.SimpleColoredText;
++import com.intellij.ui.SimpleTextAttributes;
  import com.intellij.util.Consumer;
  import com.intellij.util.Icons;
  import com.intellij.util.NullableFunction;
  import com.intellij.util.Processor;
  import com.intellij.util.containers.ContainerUtil;
--import com.intellij.ui.SimpleColoredText;
--import com.intellij.ui.SimpleTextAttributes;
  import org.intellij.plugins.intelliLang.AdvancedSettingsUI;
  import org.intellij.plugins.intelliLang.Configuration;
  import org.intellij.plugins.intelliLang.inject.AbstractLanguageInjectionSupport;
@@@ -62,8 -62,8 +62,8 @@@ import org.jetbrains.annotations.NotNul
  import org.jetbrains.annotations.Nullable;
  
  import java.util.*;
--import java.util.regex.Pattern;
  import java.util.regex.Matcher;
++import java.util.regex.Pattern;
  
  import static org.intellij.plugins.intelliLang.inject.config.MethodParameterInjection.*;
  
index 2610c4e47330b68fffbb7810e6de43a5a00a5cf1,7a8df656e69d3c2a34afa7eab90d4c04184a5db2..ad764c365c70f21e987fa6f20d73ec59d5dd4879
@@@ -38,9 -40,10 +40,11 @@@ import com.intellij.util.PairProcessor
  import com.intellij.util.containers.ConcurrentFactoryMap;
  import com.intellij.util.containers.ContainerUtil;
  import gnu.trove.THashMap;
+ import gnu.trove.THashSet;
  import org.intellij.plugins.intelliLang.inject.InjectorUtils;
  import org.intellij.plugins.intelliLang.inject.LanguageInjectionSupport;
--import org.intellij.plugins.intelliLang.inject.config.*;
++import org.intellij.plugins.intelliLang.inject.config.BaseInjection;
++import org.intellij.plugins.intelliLang.inject.config.InjectionPlace;
  import org.jdom.Document;
  import org.jdom.Element;
  import org.jdom.JDOMException;
index 0000000000000000000000000000000000000000,02faaed56cb8c98172ae1de0c3d1433855080f43..0265fa81a433edf34917ebdb7c618cac78a2baba
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,61 +1,60 @@@
 -import org.jetbrains.plugins.groovy.lang.resolve.processors.ClassHint;
+ /*
+  * Copyright 2000-2010 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.intellij.plugins.intelliLang.inject.groovy;
+ import com.intellij.openapi.project.Project;
+ import com.intellij.openapi.util.AtomicNotNullLazyValue;
+ import com.intellij.openapi.util.Key;
+ import com.intellij.openapi.util.UserDataHolderEx;
+ import com.intellij.psi.*;
+ import com.intellij.psi.scope.PsiScopeProcessor;
+ import org.intellij.plugins.intelliLang.PatternBasedInjectionHelper;
+ import org.intellij.plugins.intelliLang.inject.config.BaseInjection;
+ import org.jetbrains.annotations.NotNull;
+ import org.jetbrains.plugins.groovy.GroovyFileType;
+ import org.jetbrains.plugins.groovy.lang.resolve.NonCodeMembersProcessor;
+ import org.jetbrains.plugins.groovy.lang.resolve.ResolveUtil;
+ /**
+  * @author Gregory.Shrago
+  */
+ public class PatternEditorContextMembersProvider implements NonCodeMembersProcessor {
+   public static final Key<AtomicNotNullLazyValue<PsiFile>> INJECTION_PARSED_CONTEXT = Key.create("INJECTION_PARSED_CONTEXT");
+   public boolean processNonCodeMembers(PsiType type, PsiScopeProcessor processor, PsiElement place, boolean forCompletion) {
+     final PsiFile file = place.getContainingFile().getOriginalFile();
+     final BaseInjection injection = file.getUserData(BaseInjection.INJECTION_KEY);
+     if (injection == null) return true;
+     final PsiFile contextFile =
+       ((UserDataHolderEx)file).putUserDataIfAbsent(INJECTION_PARSED_CONTEXT, new AtomicNotNullLazyValue<PsiFile>() {
+         @NotNull
+         @Override
+         protected PsiFile compute() {
+           return parseInjectionContext(injection, file.getProject());
+         }
+       }).getValue();
+     for (PsiElement cur = contextFile.getFirstChild(); cur != null; cur = cur.getNextSibling()) {
+       if (cur instanceof PsiNamedElement && !ResolveUtil.processElement(processor, (PsiNamedElement)cur)) return false;
+     }
+     return true;
+   }
+   private static PsiFile parseInjectionContext(@NotNull BaseInjection injection, Project project) {
+     final String text = PatternBasedInjectionHelper.dumpContextDeclarations(injection.getSupportId());
+     return PsiFileFactory.getInstance(project).createFileFromText("context.groovy", GroovyFileType.GROOVY_FILE_TYPE, text);
+   }
+ }
index e24a85d8d11dc76beff6b2fad2fbb1458e32ade0,1d935e3afdbfb7879b288846a1ee42af31ee88a5..2cf2e87640058f1d6518cec50c2cc3a4363585bd
  
  package org.jetbrains.plugins.groovy.lang.psi.api.statements;
  
+ import org.jetbrains.annotations.NotNull;
++import org.jetbrains.annotations.Nullable;
  import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElement;
  import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrOpenBlock;
--import org.jetbrains.annotations.Nullable;
  
  /**
   * @author ilyas
index 81f3d30f028e3e052b5bacccf32c0218ea7442f6,f1706a99b5b1e70f9b82bd172f68a37a777a026d..7bdae5a3ae8b71de9843b64dd50f082dfb1270a9
@@@ -21,7 -21,8 +21,8 @@@ import com.intellij.openapi.util.TextRa
  import com.intellij.psi.*;
  import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry;
  import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference;
 -import com.intellij.psi.util.InheritanceUtil;
  import com.intellij.psi.tree.IElementType;
++import com.intellij.psi.util.InheritanceUtil;
  import com.intellij.psi.util.PropertyUtil;
  import com.intellij.util.ArrayUtil;
  import com.intellij.util.IncorrectOperationException;
index 6c7adedba5e17bd6f206c1aefc1d888fe451e7db,ca223305060212372f72adfcf10df6b2a0ee041b..e35f179ec3446617b9fb6d142d40bffc56f78ad3
@@@ -26,12 -26,12 +26,12 @@@ import com.intellij.psi.util.PsiTreeUti
  import com.intellij.psi.util.PsiUtil;
  import com.intellij.refactoring.introduceParameter.IntroduceParameterData;
  import com.intellij.refactoring.introduceParameter.IntroduceParameterMethodUsagesProcessor;
--import com.intellij.util.VisibilityUtil;
--import com.intellij.refactoring.util.usageInfo.DefaultConstructorImplicitUsageInfo;
  import com.intellij.refactoring.util.javadoc.MethodJavaDocHelper;
++import com.intellij.refactoring.util.usageInfo.DefaultConstructorImplicitUsageInfo;
  import com.intellij.usageView.UsageInfo;
  import com.intellij.util.ArrayUtil;
  import com.intellij.util.IncorrectOperationException;
++import com.intellij.util.VisibilityUtil;
  import com.intellij.util.containers.MultiMap;
  import gnu.trove.TIntArrayList;
  import gnu.trove.TIntProcedure;
@@@ -49,7 -49,7 +49,8 @@@ import org.jetbrains.plugins.groovy.lan
  import org.jetbrains.plugins.groovy.refactoring.GroovyRefactoringBundle;
  import org.jetbrains.plugins.groovy.refactoring.GroovyRefactoringUtil;
  
--import java.util.*;
++import java.util.HashSet;
++import java.util.Set;
  
  /**
   * @author Maxim.Medvedev
index a02797bbe10fb327ede197dfd3420af2123850a6,d88634a6f5770662ad907981b5f620e725c641d0..a1165622bdaa22f776c6fa44f33a35c90ea4d84e
  
  package org.jetbrains.plugins.groovy.compiler;
  
--import com.intellij.compiler.CompilerConfiguration;
  
--
--import com.intellij.openapi.module.Module;
--import com.intellij.openapi.vfs.VirtualFile;
--import com.intellij.psi.PsiFile;
--import junit.framework.AssertionFailedError;
++import com.intellij.compiler.CompilerConfiguration
++import com.intellij.openapi.module.Module
++import com.intellij.openapi.vfs.VirtualFile
++import com.intellij.psi.PsiFile
++import junit.framework.AssertionFailedError
  
  /**
   * @author peter
index 0000000000000000000000000000000000000000,4498755a3cbfb54fbe63d3489cbf5dd699b59ebd..91cd6c8cbeefb027df15bba0d37cb9af23ae070f
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,19 +1,19 @@@
 -import java.util.*;
++import java.util.List;
+ class A {
+     List <caret>method() { }
+ }
+ class Q implements List, Runnable  {
+ }
+ class Z implements List {
+ }
+ class B extends A {
+     Q method() { }
+ }
+ class C extends A {
+     Z method() { }
+ }
index 0000000000000000000000000000000000000000,289fc99a63b88d70424ec830e9d6ed1934dc24b4..e81cb0e3cec1ee2cc3881efa366eb452717c592e
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,19 +1,19 @@@
 -import java.util.*;
++import java.util.List;
+ class A {
+     Runnable method() { }
+ }
+ class Q implements List, Runnable  {
+ }
+ class Z implements List {
+ }
+ class B extends A {
+     Q method() { }
+ }
+ class C extends A {
+     Runnable method() { }
+ }
index 8478f6552a8b7d2909b666ccc929a755012063fa,0fb79d73d0e3d212936518f50262be8e423d76d1..aef14aedcc219cbc96fad2b2984dd62d56c94ab9
  // limitations under the License.
  package org.zmlx.hg4idea;
  
 -import com.intellij.openapi.editor.*;
 -import com.intellij.openapi.fileEditor.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.vcsUtil.*;
 -import org.zmlx.hg4idea.command.*;
 -import org.zmlx.hg4idea.ui.*;
 +import com.intellij.openapi.editor.Document;
 +import com.intellij.openapi.editor.Editor;
 +import com.intellij.openapi.fileEditor.FileDocumentManager;
 +import com.intellij.openapi.fileEditor.FileEditorManager;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import com.intellij.vcsUtil.VcsUtil;
 +import org.zmlx.hg4idea.command.HgTagBranchCommand;
++import org.zmlx.hg4idea.command.HgWorkingCopyRevisionsCommand;
 +import org.zmlx.hg4idea.ui.HgCurrentBranchStatus;
  
 -import java.util.*;
++import java.util.Collections;
++import java.util.List;
  class HgCurrentBranchStatusUpdater implements HgUpdater {
  
    private final HgCurrentBranchStatus hgCurrentBranchStatus;
index 0000000000000000000000000000000000000000,aec0b6d0112b4c71bf0f16960e46f46955667d52..f9b10b4e1a7fc657b8376c608e1de1db96cd51f0
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,33 +1,33 @@@
 -import com.intellij.openapi.vcs.*;
 -import org.zmlx.hg4idea.command.*;
+ // Copyright 2010 Victor Iacoban
+ //
+ // 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.zmlx.hg4idea;
++import com.intellij.openapi.vcs.VcsException;
++import org.zmlx.hg4idea.command.HgCommandResult;
+ public abstract class HgErrorHandler {
+   
+   public static HgCommandResult ensureSuccess(HgCommandResult result) throws VcsException {
+     if (fatalErrorOccurred(result)) {
+       throw new VcsException(result.getRawError());
+     }
+     return result;
+   }
+   private static boolean fatalErrorOccurred(HgCommandResult result) {
+     return 
+       result.getExitValue() == 255 ||
+       result.getRawError().contains("** unknown exception encountered");
+   }
+   
+ }
index c4663ce7f928145de0a14bbb407d21086ab9e663,3e99ab843e54ec28e28217cb9e5f5f480fe7247a..175538e7bb31df73fbeeccf1eb0382e6215a43c4
  // limitations under the License.
  package org.zmlx.hg4idea;
  
 -import com.intellij.openapi.project.*;
 -import org.zmlx.hg4idea.command.*;
 -import org.zmlx.hg4idea.ui.*;
 +import com.intellij.openapi.project.Project;
++import org.zmlx.hg4idea.command.HgVersionCommand;
 +import org.zmlx.hg4idea.ui.HgSetExecutableDialog;
  
- import java.io.File;
- /**
-  * Validates the 'hg' executable file, which is specified in {@link HgGlobalSettings}}.
-  * Checks that the file specified exists and invokes the {@link org.zmlx.hg4idea.ui.HgSetExecutableDialog}
-  * if not. The dialog provides more detailed validation.
-  */
  class HgExecutableValidator {
  
-   private final Project myProject;
+   private final Project project;
  
    public HgExecutableValidator(Project project) {
-     this.myProject = project;
+     this.project = project;
    }
  
    public boolean check(HgGlobalSettings globalSettings) {
index 63d5ef6cfae07d09b08f07fa967806a63d3f7e7e,22167ba20b705fb16b834bdbe13ce4b41b2509b6..32120b91dd500149b3a11735f4be33b419e55944
  // limitations under the License.
  package org.zmlx.hg4idea;
  
 -import com.intellij.openapi.application.*;
 -import com.intellij.openapi.progress.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vcs.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.command.*;
 -import org.zmlx.hg4idea.ui.*;
++import com.intellij.openapi.application.ApplicationManager;
++import com.intellij.openapi.progress.ProgressIndicator;
++import com.intellij.openapi.progress.Task;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.vcs.ProjectLevelVcsManager;
 +import com.intellij.openapi.vcs.VcsRoot;
- import com.intellij.openapi.progress.Task;
- import com.intellij.openapi.progress.ProgressIndicator;
- import com.intellij.openapi.application.ApplicationManager;
++import org.jetbrains.annotations.NotNull;
 +import org.zmlx.hg4idea.command.HgIncomingCommand;
 +import org.zmlx.hg4idea.ui.HgChangesetStatus;
- import org.jetbrains.annotations.NotNull;
  
- import java.io.File;
 -import java.util.*;
 +import java.util.LinkedList;
 +import java.util.List;
  
  class HgIncomingStatusUpdater implements HgUpdater {
  
index 6cf9d12d8e6b6601fae1f2663b78166a5f1f9015,f48b088c386118c874fa52658c26342f7ff3a035..ed76eba63778db5b044c1c25140c2d5c6a8c667c
  // limitations under the License.
  package org.zmlx.hg4idea;
  
 -import com.intellij.openapi.application.*;
 -import com.intellij.openapi.progress.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vcs.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.command.*;
 -import org.zmlx.hg4idea.ui.*;
++import com.intellij.openapi.application.ApplicationManager;
++import com.intellij.openapi.progress.ProgressIndicator;
++import com.intellij.openapi.progress.Task;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.vcs.ProjectLevelVcsManager;
 +import com.intellij.openapi.vcs.VcsRoot;
- import com.intellij.openapi.progress.Task;
- import com.intellij.openapi.progress.ProgressIndicator;
- import com.intellij.openapi.application.ApplicationManager;
++import org.jetbrains.annotations.NotNull;
 +import org.zmlx.hg4idea.command.HgOutgoingCommand;
 +import org.zmlx.hg4idea.ui.HgChangesetStatus;
- import org.jetbrains.annotations.NotNull;
  
- import java.io.File;
 -import java.util.*;
 +import java.util.LinkedList;
 +import java.util.List;
  
  class HgOutgoingStatusUpdater implements HgUpdater {
  
index f9d4ad46d03043f24a2ceaa7f50f28fd7a1332ac,daf72a20bf96202f1b4161e83e67e29c9a73428e..5316051435a4b093252c59db360fc95085489410
  // limitations under the License.
  package org.zmlx.hg4idea;
  
 -import com.intellij.openapi.vcs.history.*;
 -import org.apache.commons.lang.builder.*;
 +import com.intellij.openapi.vcs.history.VcsRevisionNumber;
 +import org.apache.commons.lang.builder.HashCodeBuilder;
  
 -import java.util.*;
++import java.util.Collections;
++import java.util.List;
  public final class HgRevisionNumber implements VcsRevisionNumber {
  
    private final String revision;
index 0000000000000000000000000000000000000000,6c28e04e5d06c5801e8765cd468aff96b885a9ff..ad88c5d986b7bf5f70b41c95f10a1bd12efdc179
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,156 +1,157 @@@
 -import com.intellij.openapi.application.*;
 -import com.intellij.openapi.project.*;
+ // Copyright 2010 Victor Iacoban
+ //
+ // 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.zmlx.hg4idea;
 -import com.intellij.openapi.vcs.changes.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.vcsUtil.*;
++import com.intellij.openapi.application.Application;
++import com.intellij.openapi.application.ApplicationManager;
++import com.intellij.openapi.project.Project;
+ import com.intellij.openapi.vcs.FilePath;
++import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
++import com.intellij.openapi.vfs.VirtualFile;
++import com.intellij.vcsUtil.VcsUtil;
+ import org.jetbrains.annotations.Nullable;
+ import java.io.*;
+ /**
+  * <strong><font color="#FF0000">TODO JavaDoc.</font></strong>
+  */
+ public abstract class HgUtil {
+   
+   public static File copyResourceToTempFile(String basename, String extension) throws IOException {
+     final InputStream in = HgUtil.class.getClassLoader().getResourceAsStream("python/" + basename + extension);
+     final File tempFile = File.createTempFile(basename, extension);
+     final byte[] buffer = new byte[4096];
+     OutputStream out = null;
+     try {
+       out = new FileOutputStream(tempFile, false);
+       int bytesRead;
+       while ((bytesRead = in.read(buffer)) != -1)
+         out.write(buffer, 0, bytesRead);
+     } finally {
+       try {
+         out.close();
+       }
+       catch (IOException e) {
+         // ignore
+       }
+     }
+     try {
+       in.close();
+     }
+     catch (IOException e) {
+       // ignore
+     }
+     tempFile.deleteOnExit();
+     return tempFile;
+   }
+   public static void markDirectoryDirty( final Project project, final FilePath file ) {
+     Application application = ApplicationManager.getApplication();
+     application.runReadAction(new Runnable() {
+       public void run() {
+         VcsDirtyScopeManager.getInstance(project).dirDirtyRecursively(file);
+       }
+     } );
+     application.runWriteAction(new Runnable() {
+       public void run() {
+         VirtualFile virtualFile = VcsUtil.getVirtualFile(file.getPath());
+         if (virtualFile != null) {
+           virtualFile.refresh(true, true);
+         }
+       }
+     } );
+   }
+   public static void markDirectoryDirty( final Project project, final VirtualFile file ) {
+     Application application = ApplicationManager.getApplication();
+     application.runReadAction(new Runnable() {
+       public void run() {
+         VcsDirtyScopeManager.getInstance(project).dirDirtyRecursively(file);
+       }
+     } );
+     application.runWriteAction(new Runnable() {
+       public void run() {
+         file.refresh(true, true);
+       }
+     } );
+   }
+   public static void markFileDirty( final Project project, final FilePath file ) {
+     Application application = ApplicationManager.getApplication();
+     application.runReadAction(new Runnable() {
+       public void run() {
+         VcsDirtyScopeManager.getInstance(project).fileDirty(file);
+       }
+     } );
+     application.runWriteAction(new Runnable() {
+       public void run() {
+         VirtualFile virtualFile = VcsUtil.getVirtualFile(file.getPath());
+         if (virtualFile != null) {
+           virtualFile.refresh(true, false);
+         }
+       }
+     } );
+   }
+   public static void markFileDirty( final Project project, final VirtualFile file ) {
+     Application application = ApplicationManager.getApplication();
+     application.runReadAction(new Runnable() {
+       public void run() {
+         VcsDirtyScopeManager.getInstance(project).fileDirty(file);
+       }
+     } );
+     application.runWriteAction(new Runnable() {
+       public void run() {
+         file.refresh(true, false);
+       }
+     } );
+   }
+   /**
+    * Returns a temporary python file that will be deleted on exit.
+    * 
+    * Also all compiled version of the python file will be deleted.
+    * 
+    * @param base The basename of the file to copy
+    * @return The temporary copy the specified python file, with all the necessary hooks installed
+    * to make sure it is completely removed at shutdown
+    */
+   @Nullable
+   public static File getTemporaryPythonFile(String base) {
+     try {
+       final File file = copyResourceToTempFile(base, ".py");
+       final String fileName = file.getName();
+       Runtime.getRuntime().addShutdownHook(new Thread(){
+         @Override
+         public void run() {
+           File[] files = file.getParentFile().listFiles(new FilenameFilter() {
+             public boolean accept(File dir, String name) {
+               return name.startsWith(fileName);
+             }
+           });
+           if (files != null) {
+             for (File file1 : files) {
+               file1.delete();
+             }
+           }
+         }
+       });
+       return file;
+     } catch (IOException e) {
+       return null;
+     }
+   }
+ }
index bf6d9230b5d5414f626a5636883b5b97b2102aef,848cfef09c634e1738c5af2fee86a315ab1c8e48..f31fa0bd6e6cd9867427b36e3319499c4f692588
  // limitations under the License.
  package org.zmlx.hg4idea;
  
 -import com.intellij.concurrency.*;
 -import com.intellij.openapi.application.*;
 -import com.intellij.openapi.fileEditor.*;
 -import com.intellij.openapi.options.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.util.*;
 -import com.intellij.openapi.vcs.*;
 -import com.intellij.openapi.vcs.annotate.*;
 -import com.intellij.openapi.vcs.changes.*;
 -import com.intellij.openapi.vcs.checkin.*;
 -import com.intellij.openapi.vcs.diff.*;
 -import com.intellij.openapi.vcs.history.*;
 -import com.intellij.openapi.vcs.rollback.*;
 -import com.intellij.openapi.vcs.update.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.openapi.wm.*;
 -import com.intellij.util.messages.*;
 +import com.intellij.concurrency.JobScheduler;
 +import com.intellij.openapi.application.ApplicationManager;
 +import com.intellij.openapi.fileEditor.FileEditorManagerAdapter;
 +import com.intellij.openapi.fileEditor.FileEditorManagerEvent;
 +import com.intellij.openapi.fileEditor.FileEditorManagerListener;
 +import com.intellij.openapi.options.Configurable;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.util.IconLoader;
 +import com.intellij.openapi.vcs.AbstractVcs;
 +import com.intellij.openapi.vcs.CommittedChangesProvider;
 +import com.intellij.openapi.vcs.ProjectLevelVcsManager;
++import com.intellij.openapi.vcs.VcsException;
 +import com.intellij.openapi.vcs.annotate.AnnotationProvider;
 +import com.intellij.openapi.vcs.changes.ChangeListManager;
 +import com.intellij.openapi.vcs.changes.ChangeProvider;
 +import com.intellij.openapi.vcs.checkin.CheckinEnvironment;
 +import com.intellij.openapi.vcs.diff.DiffProvider;
 +import com.intellij.openapi.vcs.history.VcsHistoryProvider;
 +import com.intellij.openapi.vcs.rollback.RollbackEnvironment;
 +import com.intellij.openapi.vcs.update.UpdateEnvironment;
 +import com.intellij.openapi.vfs.LocalFileSystem;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import com.intellij.openapi.wm.StatusBar;
 +import com.intellij.openapi.wm.WindowManager;
 +import com.intellij.util.messages.MessageBus;
 +import com.intellij.util.messages.MessageBusConnection;
 +import com.intellij.util.messages.Topic;
  import org.zmlx.hg4idea.provider.*;
 -import org.zmlx.hg4idea.provider.annotate.*;
 -import org.zmlx.hg4idea.provider.commit.*;
 -import org.zmlx.hg4idea.provider.update.*;
 -import org.zmlx.hg4idea.ui.*;
 +import org.zmlx.hg4idea.provider.annotate.HgAnnotationProvider;
 +import org.zmlx.hg4idea.provider.commit.HgCheckinEnvironment;
 +import org.zmlx.hg4idea.provider.commit.HgCommitExecutor;
 +import org.zmlx.hg4idea.provider.update.HgIntegrateEnvironment;
 +import org.zmlx.hg4idea.provider.update.HgUpdateEnvironment;
 +import org.zmlx.hg4idea.ui.HgChangesetStatus;
 +import org.zmlx.hg4idea.ui.HgCurrentBranchStatus;
  
  import javax.swing.*;
 -import java.util.concurrent.*;
 +import java.util.concurrent.ScheduledFuture;
 +import java.util.concurrent.TimeUnit;
  
  public class HgVcs extends AbstractVcs {
  
index 8d3409179a4ff7b18e34c47b20c1c99d6477a6c9,c1445965d595dc68788ca63394ce02ec83347c7d..dde9e9da2413f1e59605c8d10641e95e5777ec3c
  // limitations under the License.
  package org.zmlx.hg4idea;
  
 -import com.intellij.openapi.fileTypes.*;
 -import com.intellij.openapi.project.*;
 +import com.intellij.openapi.fileTypes.FileTypeManager;
 +import com.intellij.openapi.project.Project;
- import com.intellij.openapi.vcs.AbstractVcs;
- import com.intellij.openapi.vcs.AbstractVcsHelper;
- import com.intellij.openapi.vcs.FileStatus;
- import com.intellij.openapi.vcs.FileStatusManager;
- import com.intellij.openapi.vcs.ProjectLevelVcsManager;
- import com.intellij.openapi.vcs.VcsConfiguration;
- import com.intellij.openapi.vcs.VcsShowConfirmationOption;
- import static com.intellij.openapi.vcs.VcsShowConfirmationOption.Value.DO_ACTION_SILENTLY;
- import static com.intellij.openapi.vcs.VcsShowConfirmationOption.Value.SHOW_CONFIRMATION;
+ import com.intellij.openapi.vcs.*;
 -import com.intellij.openapi.vcs.FilePath;
 -import com.intellij.openapi.vcs.changes.*;
 +import com.intellij.openapi.vcs.changes.ChangeListManager;
- import com.intellij.openapi.vfs.VirtualFile;
- import com.intellij.openapi.vfs.VirtualFileAdapter;
- import com.intellij.openapi.vfs.VirtualFileCopyEvent;
- import com.intellij.openapi.vfs.VirtualFileEvent;
- import com.intellij.openapi.vfs.VirtualFileMoveEvent;
- import com.intellij.openapi.vfs.VirtualFilePropertyEvent;
+ import com.intellij.openapi.vfs.*;
 -import com.intellij.vcsUtil.*;
 -import org.jetbrains.annotations.*;
 +import com.intellij.vcsUtil.VcsUtil;
- import org.zmlx.hg4idea.command.HgAddCommand;
- import org.zmlx.hg4idea.command.HgCopyCommand;
- import org.zmlx.hg4idea.command.HgMoveCommand;
- import org.zmlx.hg4idea.command.HgRemoveCommand;
++import org.jetbrains.annotations.NotNull;
+ import org.zmlx.hg4idea.command.*;
  
 -import java.io.*;
 -import java.util.*;
 +import java.io.File;
 +import java.util.Arrays;
  
 -import static com.intellij.openapi.vcs.VcsShowConfirmationOption.Value.*;
++import static com.intellij.openapi.vcs.VcsShowConfirmationOption.Value.DO_ACTION_SILENTLY;
++import static com.intellij.openapi.vcs.VcsShowConfirmationOption.Value.SHOW_CONFIRMATION;
  public class HgVirtualFileListener extends VirtualFileAdapter {
  
    private final Project project;
index 1ee4986c3dd5cb21b279886b290cc3991bdbef98,c4d3e2b033fe33c68ab522367e75c19d3f282a52..ef3ed38f30316a09affd882f9e7904ab257b9bdc
  package org.zmlx.hg4idea.action;
  
  import com.intellij.openapi.actionSystem.*;
 -import com.intellij.openapi.application.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vcs.*;
 -import com.intellij.openapi.vfs.*;
 -import org.zmlx.hg4idea.*;
 +import com.intellij.openapi.application.ApplicationManager;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.vcs.AbstractVcsHelper;
 +import com.intellij.openapi.vcs.ProjectLevelVcsManager;
 +import com.intellij.openapi.vcs.TransactionRunnable;
 +import com.intellij.openapi.vcs.VcsException;
- import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
 +import com.intellij.openapi.vfs.VirtualFile;
++import org.zmlx.hg4idea.HgUtil;
 +import org.zmlx.hg4idea.HgVcs;
  
 -import java.util.*;
 +import java.util.LinkedList;
 +import java.util.List;
  
  abstract class HgAbstractFilesAction extends AnAction {
  
index 5dc7564d49a5cd917bf863edaf9cc97ed7ea381a,ac4f59b2d72c94d145b8162a8edbb923cdb449c5..2661de3f72d257cebb7a2a2f7ba9929bcf224b9d
  package org.zmlx.hg4idea.action;
  
  import com.intellij.openapi.actionSystem.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vcs.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.vcsUtil.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.*;
 -import org.zmlx.hg4idea.command.*;
 -
 -import java.util.*;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.vcs.ProjectLevelVcsManager;
 +import com.intellij.openapi.vcs.VcsRoot;
- import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import com.intellij.vcsUtil.VcsUtil;
 +import org.jetbrains.annotations.Nullable;
++import org.zmlx.hg4idea.HgUtil;
 +import org.zmlx.hg4idea.HgVcs;
 +import org.zmlx.hg4idea.command.HgCommandException;
 +
 +import java.util.Collection;
 +import java.util.LinkedList;
 +import java.util.List;
  
  abstract class HgAbstractGlobalAction extends AnAction {
  
index 44ea05ed37d9825360f73d1b6be038d3af7659e1,7471680491aac40d05ee15562fe7147e2b324e91..279d68b7b01e5688c2fa158de240e2c20e8828a7
  // limitations under the License.
  package org.zmlx.hg4idea.action;
  
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vfs.*;
 -import org.apache.commons.lang.*;
 -import org.zmlx.hg4idea.*;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import org.apache.commons.lang.StringUtils;
 +import org.zmlx.hg4idea.HgFile;
- import org.zmlx.hg4idea.HgRevisionNumber;
- import org.zmlx.hg4idea.command.HgHeadsCommand;
- import org.zmlx.hg4idea.command.HgMQCommand;
- import org.zmlx.hg4idea.command.HgPullCommand;
- import org.zmlx.hg4idea.command.HgRebaseCommand;
- import org.zmlx.hg4idea.command.HgResolveCommand;
- import org.zmlx.hg4idea.command.HgResolveStatusEnum;
- import org.zmlx.hg4idea.command.HgTagBranchCommand;
+ import org.zmlx.hg4idea.command.*;
 -import org.zmlx.hg4idea.provider.update.*;
 -import org.zmlx.hg4idea.ui.*;
 +import org.zmlx.hg4idea.provider.update.HgConflictResolver;
 +import org.zmlx.hg4idea.ui.HgPullDialog;
  
 -import java.util.*;
 +import java.util.Collection;
- import java.util.Collections;
- import java.util.List;
 +import java.util.Map;
  
  public class HgMqRebaseAction extends HgAbstractGlobalAction {
  
index 987ce87eba9acd8f19988b0ce8ae6b246acba70e,1652e0a5f7aff431bc53903fab6528e6bef853ff..71d5bd095f61b90cc43f0ac483e295cc68e075c1
  // limitations under the License.
  package org.zmlx.hg4idea.action;
  
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vfs.*;
 -import org.zmlx.hg4idea.provider.update.*;
 -import org.zmlx.hg4idea.ui.*;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.vfs.VirtualFile;
- import org.zmlx.hg4idea.HgRevisionNumber;
- import org.zmlx.hg4idea.command.HgHeadsCommand;
- import org.zmlx.hg4idea.command.HgTagBranchCommand;
 +import org.zmlx.hg4idea.provider.update.HgConflictResolver;
 +import org.zmlx.hg4idea.ui.HgRunConflictResolverDialog;
  
 -import java.util.*;
 +import java.util.Collection;
- import java.util.Collections;
- import java.util.List;
  
  public class HgRunConflictResolverAction extends HgAbstractGlobalAction {
  
index 0000000000000000000000000000000000000000,3e446a88067824ccbaed2228479e81f83cf269a0..6fa7b9c3b41881ec3e7967eab1eafd440e020dd1
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,80 +1,83 @@@
 -import com.intellij.openapi.diagnostic.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vfs.*;
 -import org.apache.commons.lang.*;
 -import org.zmlx.hg4idea.*;
 -
 -import java.util.*;
+ // Copyright 2008-2010 Victor Iacoban
+ //
+ // 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.zmlx.hg4idea.command;
++import com.intellij.openapi.diagnostic.Logger;
++import com.intellij.openapi.project.Project;
++import com.intellij.openapi.vfs.VirtualFile;
++import org.apache.commons.lang.StringUtils;
++import org.zmlx.hg4idea.HgRevisionNumber;
++
++import java.util.ArrayList;
++import java.util.Arrays;
++import java.util.Collections;
++import java.util.List;
+ /**
+  * Abstract base class for all commands that need to parse changeset information.
+  */
+ public abstract class HgChangesetsCommand {
+   private static final Logger LOG = Logger.getInstance(HgChangesetsCommand.class.getName());
+   private static final String SEPARATOR_STRING = "\u0017"; //ascii: end of transmission block
+   
+   private final Project project;
+   private final String command;
+   public HgChangesetsCommand(Project project, String command) {
+     this.project = project;
+     this.command = command;
+   }
+   public List<HgRevisionNumber> execute(VirtualFile repo) {
+     return getRevisions(repo);
+   }
+   protected List<HgRevisionNumber> getRevisions(VirtualFile repo) {
+     HgCommandService commandService = HgCommandService.getInstance(project);
+     List<String> args = new ArrayList<String>(Arrays.asList(
+       "--template",
+       "{rev}|{node|short}|{author}|{desc|firstline}" + SEPARATOR_STRING
+     ));
+     addArguments(args);
+     HgCommandResult result = commandService.execute(
+       repo, Arrays.asList("--quiet"), command, args
+     );
+     
+     String output = result.getRawOutput();
+     if (StringUtils.isEmpty(output)) {
+       return Collections.emptyList();
+     }
+     
+     String[] changesets = output.split(SEPARATOR_STRING);
+     List<HgRevisionNumber> revisions = new ArrayList<HgRevisionNumber>(changesets.length);
+     
+     for(String changeset: changesets) {
+       String[] parts = StringUtils.split(changeset, "|", 4);
+       if (parts.length == 4) {
+         revisions.add(HgRevisionNumber.getInstance(parts[0], parts[1], parts[2], parts[3]));
+       } else {
+         LOG.warn("Could not parse changeset [" + changeset + "]");
+       }
+     }
+     
+     return revisions;
+   }
+   protected abstract void addArguments(List<String> args);
+ }
index 0000000000000000000000000000000000000000,5916b94c7b877c1049a1a479b4b6fe10b6cf2f07..cd26b3068705cac0edca82cf3e97581d5570cc4e
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,41 +1,43 @@@
 -import com.intellij.openapi.project.*;
+ package org.zmlx.hg4idea.command;
 -import java.nio.charset.*;
 -import java.util.*;
++import com.intellij.openapi.project.Project;
++import java.nio.charset.Charset;
++import java.util.Collections;
++import java.util.LinkedList;
++import java.util.List;
+ public class HgCloneCommand {
+   private final Project project;
+   private String repositoryURL;
+   private String directory;
+   public HgCloneCommand(Project project) {
+     this.project = project;
+   }
+   public String getDirectory() {
+     return directory;
+   }
+   public void setDirectory(String directory) {
+     this.directory = directory;
+   }
+   public String getRepositoryURL() {
+     return repositoryURL;
+   }
+   public void setRepositoryURL(String repositoryURL) {
+     this.repositoryURL = repositoryURL;
+   }
+   public HgCommandResult execute() {
+     List<String> arguments = new LinkedList<String>();
+     arguments.add(repositoryURL);
+     arguments.add(directory);
+     return HgCommandService.getInstance(project).execute(null, Collections.<String>emptyList(), "clone", arguments, Charset.defaultCharset());
+   }
+ }
index 0000000000000000000000000000000000000000,3773dbd865b82915ec8f6869c66c0f9fa675e460..1307bf9e2b54bc4316412d284f410eaaf7230321
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,96 +1,97 @@@
 -import com.intellij.openapi.application.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.vcsUtil.*;
 -import org.zmlx.hg4idea.ui.*;
+ // Copyright 2008-2010 Victor Iacoban
+ //
+ // 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.zmlx.hg4idea.command;
 -import java.net.*;
 -import java.util.*;
++import com.intellij.openapi.application.ApplicationManager;
++import com.intellij.openapi.application.ModalityState;
++import com.intellij.openapi.project.Project;
++import com.intellij.openapi.vfs.VirtualFile;
++import com.intellij.vcsUtil.VcsUtil;
++import org.zmlx.hg4idea.ui.HgUsernamePasswordDialog;
++import java.net.URISyntaxException;
++import java.util.List;
+ /**
+  * Base class for any command interacting with a remote repository and which needs authentication.
+  */
+ class HgCommandAuthenticator {
+   protected HgCommandResult executeCommandAndAuthenticateIfNecessary(Project project, VirtualFile localRepository, String remoteRepository, String command, List<String> arguments) {
+     HgCommandService service = HgCommandService.getInstance(project);
+     HgCommandResult result = service.execute(localRepository, command, arguments);
+     if (HgErrorUtil.isAbort(result) && HgErrorUtil.isAuthorizationRequiredAbort(result)) {
+       try {
+         HgUrl hgUrl = new HgUrl(remoteRepository);
+         if (hgUrl.supportsAuthentication()) {
+           GetPasswordRunnable runnable = new GetPasswordRunnable(project, hgUrl);
+           if (!ApplicationManager.getApplication().isDispatchThread()) {
+             ApplicationManager.getApplication().invokeAndWait(runnable, ModalityState.defaultModalityState());
+           } else {
+             runnable.run();
+           }
+           if ( runnable.isOk() ) {
+             hgUrl.setUsername( runnable.getUserName() );
+             hgUrl.setPassword(String.valueOf( runnable.getPassword() ));
+             arguments.set(arguments.size() - 1, hgUrl.asString());
+             result = service.execute(localRepository, command, arguments);
+           }
+         }
+       } catch (URISyntaxException e) {
+         VcsUtil.showErrorMessage(project, "Invalid repository: " + remoteRepository, "Error");
+       }
+     }
+     return result;
+   }
+   private static class GetPasswordRunnable implements Runnable {
+     private final HgUrl hgUrl;
+     private String userName;
+     private char[] password;
+     private Project project;
+     private boolean ok = false;
+     public GetPasswordRunnable(Project project, HgUrl hgUrl) {
+       this.hgUrl = hgUrl;
+       this.project = project;
+     }
+     public void run() {
+       HgUsernamePasswordDialog dialog = new HgUsernamePasswordDialog(project);
+       dialog.setUsername(hgUrl.getUsername());
+       dialog.show();
+       if (dialog.isOK()) {
+         userName = dialog.getUsername();
+         password = dialog.getPassword();
+         ok = true;
+       }
+     }
+     public String getUserName() {
+       return userName;
+     }
+     public char[] getPassword() {
+       return password.clone();
+     }
+     public boolean isOk() {
+       return ok;
+     }
+   }
+ }
index 1b6fe411c00b8e37bef8ceb02cc7a9da0d3383c4,f12e83b5547023804ae7c36cae2ca4ec6bf6f8ba..60ec054459a536e749b4e789df2f050151c87259
  // limitations under the License.
  package org.zmlx.hg4idea.command;
  
 -import com.intellij.openapi.application.*;
 -import com.intellij.openapi.diagnostic.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.vcsUtil.*;
 -import org.zmlx.hg4idea.*;
++import com.intellij.openapi.application.ApplicationManager;
++import com.intellij.openapi.application.ModalityState;
 +import com.intellij.openapi.diagnostic.Logger;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import com.intellij.vcsUtil.VcsUtil;
- import org.jetbrains.annotations.NotNull;
 +import org.zmlx.hg4idea.HgGlobalSettings;
- import org.zmlx.hg4idea.HgVcs;
++import org.zmlx.hg4idea.HgUtil;
 +import org.zmlx.hg4idea.HgVcsMessages;
  
 -import java.io.*;
 -import java.net.*;
 -import java.nio.charset.*;
 -import java.util.*;
+ import javax.swing.*;
+ import java.awt.*;
- import java.util.Collections;
++import java.io.DataInputStream;
++import java.io.DataOutputStream;
++import java.io.File;
++import java.io.IOException;
++import java.net.Socket;
 +import java.nio.charset.Charset;
++import java.util.Arrays;
 +import java.util.LinkedList;
  import java.util.List;
  
  public final class HgCommandService {
index a2496f61fc5eb8af0c15876982b29b4c22357dd4,e1cb8171429446bdc2f68d8f884c6ddeb9a84730..eb4aba2d55f4d2fc29e4821b11d723fa5975a1d3
  // limitations under the License.
  package org.zmlx.hg4idea.command;
  
 -import com.intellij.openapi.application.*;
 -import com.intellij.openapi.diagnostic.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vcs.*;
 -import com.intellij.openapi.vfs.*;
 -import org.apache.commons.lang.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.*;
 +import com.intellij.openapi.application.PathManager;
++import com.intellij.openapi.diagnostic.Logger;
 +import com.intellij.openapi.project.Project;
++import com.intellij.openapi.vcs.VcsException;
 +import com.intellij.openapi.vfs.VirtualFile;
- import com.intellij.openapi.diagnostic.Logger;
 +import org.apache.commons.lang.StringUtils;
 +import org.jetbrains.annotations.NotNull;
 +import org.zmlx.hg4idea.HgFile;
- import org.zmlx.hg4idea.HgVcsMessages;
 +import org.zmlx.hg4idea.HgVcs;
++import org.zmlx.hg4idea.HgVcsMessages;
  
- import java.io.BufferedWriter;
- import java.io.File;
- import java.io.FileWriter;
- import java.io.IOException;
- import java.io.Writer;
+ import java.io.*;
 -import java.util.*;
 +import java.util.Collections;
 +import java.util.LinkedList;
 +import java.util.List;
++import java.util.Set;
 -import static org.zmlx.hg4idea.HgErrorHandler.*;
++import static org.zmlx.hg4idea.HgErrorHandler.ensureSuccess;
  
  public class HgCommitCommand {
  
index a34f5d72950ba1f8b104d4521e50cddc26cd1e15,afbbe129cbddc5210c538aae0724792f389f4b0f..82bb32c3454afdc39e9dbddaef46b80749370e1d
  // limitations under the License.
  package org.zmlx.hg4idea.command;
  
- import com.intellij.openapi.diagnostic.Logger;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vfs.*;
 -import org.apache.commons.lang.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.*;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import org.apache.commons.lang.StringUtils;
 +import org.jetbrains.annotations.NotNull;
 +import org.zmlx.hg4idea.HgRevisionNumber;
  
- import java.util.ArrayList;
- import java.util.Arrays;
 -import java.util.*;
 +import java.util.List;
  
  public class HgHeadsCommand {
  
index 0000000000000000000000000000000000000000,af01433b1d77c14a13209e19605f2436a305127e..fb1b8f6a0c326acaa6d7fd43927c32a98718c8cc
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,32 +1,34 @@@
 -import com.intellij.openapi.project.*;
+ package org.zmlx.hg4idea.command;
 -import java.nio.charset.*;
 -import java.util.*;
++import com.intellij.openapi.project.Project;
++import java.nio.charset.Charset;
++import java.util.Collections;
++import java.util.LinkedList;
++import java.util.List;
+ public class HgIdentifyCommand {
+   private final Project project;
+   private String source;
+   public HgIdentifyCommand(Project project) {
+     this.project = project;
+   }
+   public String getSource() {
+     return source;
+   }
+   public void setSource(String source) {
+     this.source = source;
+   }
+   public HgCommandResult execute() {
+     List<String> arguments = new LinkedList<String>();
+     arguments.add(source);
+     HgCommandService hgCommandService = HgCommandService.getInstance(project);
+     return hgCommandService.execute(null, Collections.<String>emptyList(), "identify", arguments, Charset.defaultCharset());
+   }
+ }
index 33824e04d8f20f5a96249381deeb8cb4b852be1e,1c4cf7c5dcc3145194d728439928ed90d4a035bf..eca05bb91f646de032cdabfc2e5d30423c2ba250
  // limitations under the License.
  package org.zmlx.hg4idea.command;
  
 -import com.intellij.openapi.project.*;
 +import com.intellij.openapi.project.Project;
- import com.intellij.openapi.vfs.VirtualFile;
- import org.zmlx.hg4idea.HgFile;
  
- import java.util.Arrays;
 -import java.util.*;
++import java.util.List;
  
- public class HgIncomingCommand extends HgRevisionsCommand {
+ public class HgIncomingCommand extends HgChangesetsCommand {
  
    public HgIncomingCommand(Project project) {
-     super(project);
+     super(project, "incoming");
    }
  
    @Override
index 8d33efd63151af7bf6e9a0c1a1ade9368750247b,3ff53ab1e8a347efc3f0b90d1e42d77fc6e1063a..627e9c2a2b04bd08826717c44e8fee1295738ef1
  // limitations under the License.
  package org.zmlx.hg4idea.command;
  
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vfs.*;
 -import org.zmlx.hg4idea.*;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import org.zmlx.hg4idea.HgFile;
  
- import java.util.List;
 -import java.util.*;
 +import java.util.LinkedList;
++import java.util.List;
  
  public class HgLogCommand extends HgRevisionsCommand {
+   private boolean includeRemoved;
    private boolean followCopies;
    private boolean logFile = true;
  
index 0ae2c786b41ee35fbae513206c536e62941db4f5,d0ec61946417e17a10fd7d4e6b7c23a92b809298..c242ca28213e3795d777864949d7f748a16e3057
  // limitations under the License.
  package org.zmlx.hg4idea.command;
  
- import com.intellij.openapi.vfs.VirtualFile;
 -import com.intellij.openapi.project.*;
 +import com.intellij.openapi.project.Project;
- import org.zmlx.hg4idea.HgFile;
  
- import java.util.Arrays;
 -import java.util.*;
++import java.util.List;
  
- public class HgOutgoingCommand extends HgRevisionsCommand {
+ public class HgOutgoingCommand extends HgChangesetsCommand {
  
    public HgOutgoingCommand(Project project) {
-     super(project);
+     super(project, "outgoing");
    }
  
-   protected HgCommandResult execute(HgCommandService service, VirtualFile repo,
-     String template, int limit, HgFile hgFile) {
-     return service.execute(repo, "outgoing",
-       Arrays.asList("--newest-first", "--template", template, "--limit", String.valueOf(limit)));
+   @Override
+   protected void addArguments(List<String> args) {
+     args.add("--newest-first");
    }
  
  }
index 0000000000000000000000000000000000000000,3f7419e1fe3479962be14772761c52f301f9bbea..cc3a0339b90159037c8dbe49d1e091e8278e4151
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,39 +1,39 @@@
 -import com.intellij.openapi.project.*;
 -import org.zmlx.hg4idea.*;
+ // Copyright 2008-2010 Victor Iacoban
+ //
+ // 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.zmlx.hg4idea.command;
 -import java.util.*;
++import com.intellij.openapi.project.Project;
++import org.zmlx.hg4idea.HgRevisionNumber;
++import java.util.List;
+ public class HgParentsCommand extends HgChangesetsCommand{
+   private HgRevisionNumber revision;
+   public HgParentsCommand(Project project) {
+     super(project, "parents");
+   }
+   public void setRevision(HgRevisionNumber revision) {
+     this.revision = revision;
+   }
+   @Override
+   protected void addArguments(List<String> args) {
+     if (revision != null) {
+       args.add("--rev");
+       args.add(revision.getChangeset());
+     }
+   }
+ }
index 3f54e36763ac1875add720dd030982c71c78ace4,1b541c489b864433b01756d67b2c92279e523af7..73a73eaba8ae5e21a8c9bdde1dab83c3edd9230a
  // limitations under the License.
  package org.zmlx.hg4idea.command;
  
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vfs.*;
 -import org.apache.commons.lang.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.*;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.vfs.VirtualFile;
- import com.intellij.vcsUtil.VcsUtil;
 +import org.apache.commons.lang.StringUtils;
 +import org.jetbrains.annotations.NotNull;
- import org.zmlx.hg4idea.ui.HgUsernamePasswordDialog;
 +import org.zmlx.hg4idea.HgVcs;
  
 -import java.util.*;
 +import java.util.LinkedList;
 +import java.util.List;
- import java.net.URISyntaxException;
  
  public class HgPullCommand {
  
index 5e8a425ee22dc83f6daab71bb942f4bf75e01615,27f554d482b4f735b2040ced91a005d9de96a10a..d92ded120133a5c940318058d16358833ccb9ad8
  // limitations under the License.
  package org.zmlx.hg4idea.command;
  
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vfs.*;
 -import org.apache.commons.lang.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.*;
 -
 -import java.util.*;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.vfs.VirtualFile;
- import com.intellij.vcsUtil.VcsUtil;
 +import org.apache.commons.lang.StringUtils;
 +import org.jetbrains.annotations.NotNull;
- import org.zmlx.hg4idea.ui.HgUsernamePasswordDialog;
 +import org.zmlx.hg4idea.HgVcs;
 +
 +import java.util.LinkedList;
 +import java.util.List;
- import java.net.URISyntaxException;
  
  public class HgPushCommand {
  
index 21edb62e3158203372291cceb9089413f7037cea,94b4d8e0d1945c1d7adaab9d2d9b4480b70c5eeb..15946754397f5ca850922f90335367aeaf3220b9
  // limitations under the License.
  package org.zmlx.hg4idea.command;
  
 -import com.intellij.openapi.project.*;
 +import com.intellij.openapi.project.Project;
+ import com.intellij.openapi.vcs.FilePath;
 -import com.intellij.openapi.vcs.*;
 -import com.intellij.openapi.vfs.*;
 -import org.apache.commons.lang.*;
 -import org.zmlx.hg4idea.*;
++import com.intellij.openapi.vcs.VcsException;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import org.apache.commons.lang.StringUtils;
 +import org.zmlx.hg4idea.HgFile;
++import org.zmlx.hg4idea.HgUtil;
  
- import java.io.File;
- import java.util.Arrays;
- import java.util.Collections;
- import java.util.HashMap;
- import java.util.Map;
+ import java.io.*;
 -import java.net.*;
++import java.net.Socket;
+ import java.util.*;
 -import java.util.concurrent.*;
++import java.util.concurrent.CountDownLatch;
++import java.util.concurrent.TimeUnit;
 -import static org.zmlx.hg4idea.HgErrorHandler.*;
++import static org.zmlx.hg4idea.HgErrorHandler.ensureSuccess;
  
  public class HgResolveCommand {
  
index e861c20c0d091ad31a3fdb6fa4566424d5806515,aeed7bd3c65cb3ae60934f58d79657cc1ae82d64..f7a3d939daa4d539128f6e20e212c025c45930c3
  // limitations under the License.
  package org.zmlx.hg4idea.command;
  
 -import com.intellij.openapi.project.*;
 -import org.apache.commons.lang.*;
 -import org.zmlx.hg4idea.*;
 -
 -import java.util.*;
 +import com.intellij.openapi.project.Project;
++import org.apache.commons.lang.StringUtils;
 +import org.zmlx.hg4idea.HgFile;
++import org.zmlx.hg4idea.HgRevisionNumber;
 +
 +import java.util.Arrays;
++import java.util.LinkedList;
++import java.util.List;
  
  public class HgRevertCommand {
  
index 4bcaa827f160d138b03eeee805ba850804a54eb3,790f22caea6f46620531bf8a55a13e456e3e83c5..6c1eab066df9b552bc8b23cb3d537a3ae3d544d9
  // limitations under the License.
  package org.zmlx.hg4idea.command;
  
 -import com.intellij.openapi.diagnostic.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vfs.*;
 -import org.apache.commons.lang.*;
 -import org.zmlx.hg4idea.*;
 +import com.intellij.openapi.diagnostic.Logger;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import org.apache.commons.lang.StringUtils;
 +import org.zmlx.hg4idea.HgFile;
 +import org.zmlx.hg4idea.HgFileRevision;
 +import org.zmlx.hg4idea.HgRevisionNumber;
  
 -import java.text.*;
 +import java.text.ParseException;
 +import java.text.SimpleDateFormat;
- import java.util.Arrays;
- import java.util.Collections;
- import java.util.Date;
- import java.util.HashMap;
- import java.util.HashSet;
- import java.util.LinkedList;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
+ import java.util.*;
  
  abstract class HgRevisionsCommand {
  
index 19e26c6863735bd75c60178cf1d311e30aa91332,f5963f022bec694e67ba3a72921f9db305644954..c3774d182af2de7b192b10e413cb17ba41146349
  // limitations under the License.
  package org.zmlx.hg4idea.command;
  
 -import com.intellij.openapi.diagnostic.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vfs.*;
 -import org.apache.commons.lang.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.*;
 -
 -import java.io.*;
 +import com.intellij.openapi.diagnostic.Logger;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import org.apache.commons.lang.StringUtils;
++import org.jetbrains.annotations.NotNull;
 +import org.zmlx.hg4idea.HgFile;
++import org.zmlx.hg4idea.HgRevisionNumber;
 +
 +import java.io.File;
- import java.util.Collections;
- import java.util.HashSet;
- import java.util.LinkedList;
- import java.util.List;
- import java.util.Set;
+ import java.util.*;
  
  public class HgStatusCommand {
  
index 0000000000000000000000000000000000000000,59c98a1d374bdd42e39acffb2f56a7f8442a530c..714ca336b3e94433b67235e8ef674405ae1ba3aa
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,146 +1,146 @@@
 -import com.intellij.openapi.diagnostic.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vfs.*;
 -import org.apache.commons.lang.*;
 -import org.zmlx.hg4idea.*;
+ // Copyright 2008-2010 Victor Iacoban
+ //
+ // 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.zmlx.hg4idea.command;
++import com.intellij.openapi.diagnostic.Logger;
++import com.intellij.openapi.project.Project;
++import com.intellij.openapi.vfs.VirtualFile;
++import org.apache.commons.lang.StringUtils;
++import org.zmlx.hg4idea.HgFile;
+ import java.util.*;
+ class HgTrackFileNamesAccrossRevisionsCommand {
+   private static final Logger LOG = Logger.getInstance(HgTrackFileNamesAccrossRevisionsCommand.class.getName());
+   private static final String SEPARATOR_STRING = "\u0027"; //ascii: end of transmission block
+   private static final String TEMPLATE = "{rev}|{file_dels}|{file_copies}" + SEPARATOR_STRING;
+   private static final int ITEM_COUNT = 3;
+   private static final int REVISION_INDEX = 0;
+   private static final int FILES_DELETED_INDEX = 1;
+   private static final int FILES_COPIED_INDEX = 2;
+   private final Project project;
+   public HgTrackFileNamesAccrossRevisionsCommand(Project project) {
+     this.project = project;
+   }
+   private HgCommandResult execute(HgCommandService service, VirtualFile repo, int limit, HgFile hgFile, String currentrevision, String givenRevision) {
+     List<String> arguments = new LinkedList<String>();
+     arguments.add("--rev");
+     arguments.add(currentrevision + ":" + givenRevision);
+     arguments.add("--follow");
+     arguments.add("--template");
+     arguments.add(TEMPLATE);
+     if (limit != -1) {
+       arguments.add("--limit");
+       arguments.add(String.valueOf(limit));
+     }
+     arguments.add(hgFile.getRelativePath());
+     return service.execute(repo, "log", arguments);
+   }
+   public final String execute(HgFile hgFile, String currentRevision, String givenRevision, int limit) {
+     if (hgFile == null || hgFile.getRepo() == null) {
+       return null;
+     }
+     HgCommandService hgCommandService = HgCommandService.getInstance(project);
+     HgCommandResult result = execute(hgCommandService, hgFile.getRepo(), limit, hgFile, currentRevision, givenRevision);
+     String output = result.getRawOutput();
+     String[] changeSets = output.split(SEPARATOR_STRING);
+     String currentFileName = hgFile.getRelativePath();
+     // needed on windows machines
+     currentFileName = currentFileName.replaceAll("\\\\", "/");
+     for (String line : changeSets) {
+       try {
+         String[] attributes = StringUtils.splitPreserveAllTokens(line, '|');
+         if (attributes.length != ITEM_COUNT) {
+           LOG.debug("Wrong format. Skipping line " + line);
+           continue;
+         }
+         String revisionString = attributes[REVISION_INDEX];
+         if (revisionString.equals(givenRevision)) {
+           return currentFileName;
+         }
+         Set<String> filesDeleted;
+         Map<String, String> copies;
+         filesDeleted = parseFileList(attributes[FILES_DELETED_INDEX]);
+         copies = parseCopiesFileList(attributes[FILES_COPIED_INDEX]);
+         // Only keep renames, i.e. copies where the source file is also deleted.
+         Iterator<String> keys = copies.keySet().iterator();
+         while (keys.hasNext()) {
+           String s = keys.next();
+           if (!filesDeleted.contains(s)) {
+             keys.remove();
+           }
+         }
+         if (copies.containsValue(currentFileName)) {
+           for (String key : copies.keySet()) {
+             if (copies.get(key).equals(currentFileName)) {
+               currentFileName = key;
+               break;
+             }
+           }
+         }
+       } catch (NumberFormatException e) {
+         LOG.warn("Error parsing rev in line " + line);
+       }
+     }
+     return null;
+   }
+   private Set<String> parseFileList(String fileListString) {
+     if (StringUtils.isEmpty(fileListString)) {
+       return Collections.emptySet();
+     } else {
+       return new HashSet<String>(Arrays.asList(fileListString.split(" ")));
+     }
+   }
+   private Map<String, String> parseCopiesFileList(String fileListString) {
+     if (StringUtils.isEmpty(fileListString)) {
+       return Collections.emptyMap();
+     } else {
+       Map<String, String> copies = new HashMap<String, String>();
+       String[] filesList = fileListString.split("\\)");
+       for (String files : filesList) {
+         String[] file = files.split(" \\(");
+         String target = file[0];
+         String source = file[1];
+         copies.put(source, target);
+       }
+       return copies;
+     }
+   }
+ }
index a39c1a691f3c184cbd7085d070b932f03f904dae,484970af9dbc3d55d93fa146e4c8c0a3cdf189f7..76b58df3ca1e8295c0eacdc6afc2d5d0ee70a918
  // limitations under the License.
  package org.zmlx.hg4idea.command;
  
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vfs.*;
 -import org.apache.commons.lang.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.*;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import org.apache.commons.lang.StringUtils;
 +import org.jetbrains.annotations.NotNull;
++import org.jetbrains.annotations.Nullable;
 +import org.zmlx.hg4idea.HgRevisionNumber;
  
 -import java.util.*;
++import java.util.ArrayList;
 +import java.util.Arrays;
 +import java.util.List;
  
  public class HgWorkingCopyRevisionsCommand {
  
index 0000000000000000000000000000000000000000,243ac3b1b18d3ff8f4df10cde51d3719eec6b286..51bcf40eda9b63c5a4ac44a0b621a241dd95d8af
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,93 +1,97 @@@
 -import java.io.*;
 -import java.net.*;
+ // Copyright 2008-2010 Victor Iacoban
+ //
+ // 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.zmlx.hg4idea.command;
++import java.io.DataInputStream;
++import java.io.DataOutputStream;
++import java.io.IOException;
++import java.net.ServerSocket;
++import java.net.Socket;
++import java.net.SocketException;
+ /**
+  * Common server class that contains the boiler-plate code to set up a server socket.
+  * The actual logic is delegated to the Protocol instance.
+  */
+ public class SocketServer {
+   protected Thread serverThread;
+   protected ServerSocket serverSocket;
+   private final Protocol protocol;
+   public SocketServer(Protocol protocol) {
+     this.protocol = protocol;
+   }
+   public int start() throws IOException {
+     serverSocket = new ServerSocket(0);
+     int port = serverSocket.getLocalPort();
+     String name = "hg4idea prompt server";
+     serverThread = new Thread(name) {
+       @Override
+       public void run() {
+         try {
+           boolean _continue = true;
+           while (_continue) {
+             Socket socket = serverSocket.accept();
+             _continue = protocol.handleConnection(socket);
+           }
+         } catch (SocketException e) {
+           //socket was closed, that's OK
+         } catch (IOException e) {
+           throw new RuntimeException(e); //TODO implement catch clause
+         }
+       }
+     };
+     serverThread.start();
+     return port;
+   }
+   public void stop() {
+     serverThread.interrupt();
+     try {
+       serverSocket.close();
+     } catch (IOException e) {
+       throw new RuntimeException(e); //TODO implement catch clause
+     }
+   }
+   public static abstract class Protocol {
+     /**
+      * Override this method to implement the actual logic of the protocol.
+      *
+      * @param socket The connected socket
+      * @return <code>true</code> if the server should keep listening for new incoming requests, 
+      *         <code>false</code> if the server handling the protocol can be shutdown.
+      * 
+      * @throws IOException when the communication over the socket gives errors.
+      */
+     public abstract boolean handleConnection(Socket socket) throws IOException;
+     protected byte[] readDataBlock(DataInputStream inputStream) throws IOException {
+       int length = inputStream.readInt();
+       byte[] data = new byte[length];
+       inputStream.readFully(data);
+       return data;
+     }
+     protected void sendDataBlock(DataOutputStream out, byte[] data) throws IOException {
+       out.writeInt(data.length);
+       out.write(data);
+     }
+   }
+ }
index 8a41340b420da22344a881bbfb14a8caa540b1e1,ac0bd625536b7b5088d6a0dca3766cb01e68a7df..e0024efbb318b0c1c1bda44ea31ab4055384641c
  // limitations under the License.
  package org.zmlx.hg4idea.provider;
  
 -import com.intellij.openapi.project.*;
 +import com.intellij.openapi.project.Project;
- import com.intellij.openapi.vcs.CachingCommittedChangesProvider;
- import com.intellij.openapi.vcs.ChangeListColumn;
- import com.intellij.openapi.vcs.FilePath;
- import com.intellij.openapi.vcs.RepositoryLocation;
- import com.intellij.openapi.vcs.VcsException;
+ import com.intellij.openapi.vcs.*;
 -import com.intellij.openapi.vcs.FilePath;
 -import com.intellij.openapi.vcs.changes.*;
 -import com.intellij.openapi.vcs.changes.committed.*;
 -import com.intellij.openapi.vcs.history.*;
 -import com.intellij.openapi.vcs.versionBrowser.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.util.*;
 -import com.intellij.vcsUtil.*;
 -import org.apache.commons.lang.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.*;
 -import org.zmlx.hg4idea.command.*;
 +import com.intellij.openapi.vcs.changes.Change;
 +import com.intellij.openapi.vcs.changes.committed.DecoratorManager;
 +import com.intellij.openapi.vcs.changes.committed.VcsCommittedListsZipper;
 +import com.intellij.openapi.vcs.changes.committed.VcsCommittedViewAuxiliary;
 +import com.intellij.openapi.vcs.history.VcsRevisionNumber;
 +import com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings;
 +import com.intellij.openapi.vcs.versionBrowser.ChangesBrowserSettingsEditor;
 +import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import com.intellij.util.AsynchConsumer;
 +import com.intellij.vcsUtil.VcsUtil;
 +import org.apache.commons.lang.StringUtils;
 +import org.jetbrains.annotations.Nls;
 +import org.jetbrains.annotations.Nullable;
 +import org.zmlx.hg4idea.HgContentRevision;
 +import org.zmlx.hg4idea.HgFile;
 +import org.zmlx.hg4idea.HgFileRevision;
 +import org.zmlx.hg4idea.HgRevisionNumber;
++import org.zmlx.hg4idea.command.HgIncomingCommand;
 +import org.zmlx.hg4idea.command.HgLogCommand;
- import org.zmlx.hg4idea.command.HgShowConfigCommand;
- import org.zmlx.hg4idea.command.HgWorkingCopyRevisionsCommand;
  
 -import java.io.*;
 +import java.io.DataInput;
 +import java.io.DataOutput;
 +import java.io.File;
 +import java.io.IOException;
- import java.net.MalformedURLException;
- import java.util.Collection;
- import java.util.Date;
- import java.util.LinkedList;
- import java.util.List;
- import java.util.Map;
+ import java.util.*;
  
  public class HgCachingCommitedChangesProvider
    implements CachingCommittedChangesProvider<CommittedChangeList, ChangeBrowserSettings> {
index c7b62511ec5379be872bd857e42c0fbc264739f7,296aa95bf1cee39b27d699d13491b86820aaf327..8972250a27317e10a274f1bb90a300b1205083ad
  // limitations under the License.
  package org.zmlx.hg4idea.provider;
  
 -import com.intellij.openapi.progress.*;
 -import com.intellij.openapi.project.*;
 +import com.intellij.openapi.progress.ProgressIndicator;
 +import com.intellij.openapi.project.Project;
  import com.intellij.openapi.vcs.FilePath;
 -import com.intellij.openapi.vcs.*;
 +import com.intellij.openapi.vcs.FileStatus;
 +import com.intellij.openapi.vcs.VcsException;
 +import com.intellij.openapi.vcs.VcsKey;
- import com.intellij.openapi.vcs.changes.Change;
- import com.intellij.openapi.vcs.changes.ChangeListManagerGate;
- import com.intellij.openapi.vcs.changes.ChangeProvider;
- import com.intellij.openapi.vcs.changes.ChangelistBuilder;
- import com.intellij.openapi.vcs.changes.ContentRevision;
- import com.intellij.openapi.vcs.changes.VcsDirtyScope;
+ import com.intellij.openapi.vcs.changes.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.vcsUtil.*;
 -import org.zmlx.hg4idea.*;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import com.intellij.vcsUtil.VcsUtil;
++import org.zmlx.hg4idea.HgContentRevision;
 +import org.zmlx.hg4idea.HgFile;
 +import org.zmlx.hg4idea.HgRevisionNumber;
- import org.zmlx.hg4idea.HgContentRevision;
- import org.zmlx.hg4idea.command.HgChange;
- import org.zmlx.hg4idea.command.HgFileStatusEnum;
- import org.zmlx.hg4idea.command.HgResolveCommand;
- import org.zmlx.hg4idea.command.HgResolveStatusEnum;
- import org.zmlx.hg4idea.command.HgStatusCommand;
- import org.zmlx.hg4idea.command.HgWorkingCopyRevisionsCommand;
+ import org.zmlx.hg4idea.command.*;
  
- import java.util.EnumMap;
- import java.util.LinkedHashSet;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
+ import java.util.*;
  
  public class HgChangeProvider implements ChangeProvider {
  
index 0000000000000000000000000000000000000000,81d2e75a61d02efe84a25892a2314802470d6fdf..11af41ca27528c113a324a9b32fa2fe33910390e
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,80 +1,83 @@@
 -import com.intellij.openapi.application.*;
 -import com.intellij.openapi.fileEditor.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vcs.*;
 -import com.intellij.openapi.vfs.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.*;
 -import org.zmlx.hg4idea.command.*;
 -import org.zmlx.hg4idea.ui.*;
+ /*
+  * Copyright 2000-2009 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.zmlx.hg4idea.provider;
 -import java.io.*;
++import com.intellij.openapi.application.ApplicationManager;
++import com.intellij.openapi.fileEditor.FileDocumentManager;
++import com.intellij.openapi.project.Project;
++import com.intellij.openapi.vcs.CheckoutProvider;
++import com.intellij.openapi.vfs.LocalFileSystem;
++import com.intellij.openapi.vfs.VirtualFile;
++import org.jetbrains.annotations.NotNull;
++import org.jetbrains.annotations.Nullable;
++import org.zmlx.hg4idea.HgUtil;
++import org.zmlx.hg4idea.command.HgCloneCommand;
++import org.zmlx.hg4idea.command.HgCommandResult;
++import org.zmlx.hg4idea.ui.HgCloneDialog;
++import java.io.File;
+ /**
+  * Checkout provider for Mercurial
+  */
+ public class HgCheckoutProvider implements CheckoutProvider {
+   /**
+    * {@inheritDoc}
+    */
+   public void doCheckout(@NotNull final Project project, @Nullable final Listener listener) {
+     ApplicationManager.getApplication().runWriteAction(new Runnable() {
+       public void run() {
+         FileDocumentManager.getInstance().saveAllDocuments();
+       }
+     });
+     HgCloneDialog dialog = new HgCloneDialog(project);
+     dialog.show();
+     if (!dialog.isOK()) {
+       return;
+     }
+     final VirtualFile destinationParent = LocalFileSystem.getInstance().findFileByIoFile(new File(dialog.getParentDirectory()));
+     if (destinationParent == null) {
+       return;
+     }
+     String targetDir = destinationParent.getPath() + File.separator + dialog.getDirectoryName();
+     final String sourceRepositoryURL = dialog.getSourceRepositoryURL();
+     HgCloneCommand clone = new HgCloneCommand(project);
+     clone.setRepositoryURL(sourceRepositoryURL);
+     clone.setDirectory(targetDir);
+     HgCommandResult result = clone.execute();
+     HgUtil.markDirectoryDirty(project,destinationParent);
+     if (result.getExitValue() == 0) {
+       if (listener != null) {
+         listener.directoryCheckedOut(new File(dialog.getParentDirectory(), dialog.getDirectoryName()));
+       }
+     }
+     if (listener != null) {
+       listener.checkoutCompleted();
+     }
+   }
+   /**
+    * {@inheritDoc}
+    */
+   public String getVcsName() {
+     return "_Mercurial";
+   }
+ }
index 9091055881d464b8c65b6176f64b7924404a0229,eaaf8bfb527e3166f9a14481c1ccc4a37a45864a..df8e22ae443a3c02bd0a08e259b70f0e50630f7a
@@@ -1,41 -1,20 +1,21 @@@
- // Copyright 2008-2010 Victor Iacoban
- //
- // 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.zmlx.hg4idea.provider;
  
 -import com.intellij.openapi.vcs.changes.*;
 -import com.intellij.openapi.vcs.versionBrowser.*;
 -import org.zmlx.hg4idea.*;
 +import com.intellij.openapi.vcs.changes.Change;
 +import com.intellij.openapi.vcs.versionBrowser.CommittedChangeListImpl;
 +import org.zmlx.hg4idea.HgRevisionNumber;
  
 -import java.util.*;
 +import java.util.Collection;
 +import java.util.Date;
  
- final class HgCommitedChangeList extends CommittedChangeListImpl {
+ public class HgCommitedChangeList extends CommittedChangeListImpl {
+   private HgRevisionNumber revision;
  
-   private HgRevisionNumber revisionNumber;
-   public HgCommitedChangeList(String comment, String committerName,
-     HgRevisionNumber revisionNumber, Date date, Collection<Change> commitDate) {
-     super(buildDisplayName(revisionNumber, comment),
-       comment, committerName, revisionNumber.getRevisionAsInt(), date, commitDate);
-     this.revisionNumber = revisionNumber;
-   }
-   public HgRevisionNumber getRevisionNumber() {
-     return revisionNumber;
+   public HgCommitedChangeList(HgRevisionNumber revision, String comment, String committerName, Date commitDate, Collection<Change> changes) {
+     super(revision.asString() + ": " + comment, comment, committerName, revision.getRevisionAsLong(), commitDate, changes);
+     this.revision = revision;
    }
  
-   private static String buildDisplayName(HgRevisionNumber number, String message) {
-     return number.asString() + " " + message;
+   public HgRevisionNumber getRevision() {
+     return revision;
    }
  }
index 846b205e9e36fe6e734a5bf18e1511a80ab5a0a6,1c48815de40980c4dd8a822bfb67053bc6454c33..8be5a7b0a9ddbc350b765727910200387254ece9
  // limitations under the License.
  package org.zmlx.hg4idea.provider;
  
- import org.zmlx.hg4idea.HgFile;
- import org.jetbrains.annotations.Nullable;
 -import com.intellij.openapi.vcs.changes.*;
 -import com.intellij.openapi.vcs.history.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.*;
++import com.intellij.openapi.vcs.changes.CurrentBinaryContentRevision;
 +import com.intellij.openapi.vcs.history.VcsRevisionNumber;
- import com.intellij.openapi.vcs.changes.BinaryContentRevision;
- import com.intellij.openapi.vcs.VcsException;
- import com.intellij.openapi.vfs.VirtualFile;
- import java.io.IOException;
- final class HgCurrentBinaryContentRevision
-   extends HgCurrentContentRevision implements BinaryContentRevision {
++import org.jetbrains.annotations.NotNull;
++import org.zmlx.hg4idea.HgFile;
  
-   private final VirtualFile virtualFile;
+ final class HgCurrentBinaryContentRevision extends CurrentBinaryContentRevision {
+   private VcsRevisionNumber revisionNumber;
  
-   HgCurrentBinaryContentRevision(HgFile hgFile,
-     VcsRevisionNumber revisionNumber, VirtualFile virtualFile) {
-     super(hgFile, revisionNumber, virtualFile);
-     this.virtualFile = virtualFile;
+   HgCurrentBinaryContentRevision(HgFile hgFile, VcsRevisionNumber revisionNumber) {
+     super(hgFile.toFilePath());
+     this.revisionNumber = revisionNumber;
    }
  
-   @Nullable
-   public byte[] getBinaryContent() throws VcsException {
-     try {
-       return virtualFile.contentsToByteArray();
-     } catch (IOException e) {
-       throw new VcsException(e);
-     }
+   @NotNull
+   @Override
+   public VcsRevisionNumber getRevisionNumber() {
+     return revisionNumber;
    }
  }
index ed093f922d3a2912d0eb5a0f7c88178e3864eab9,65338a18991c8b0ae0e2e695a5b9ac4621dfd038..89960b6e86674ad79cc41723c2a05686227e4d9d
  // limitations under the License.
  package org.zmlx.hg4idea.provider;
  
- import com.intellij.openapi.application.ApplicationManager;
- import com.intellij.openapi.editor.Document;
- import com.intellij.openapi.fileEditor.FileDocumentManager;
- import com.intellij.openapi.util.Computable;
- import com.intellij.openapi.vcs.FilePath;
- import com.intellij.openapi.vcs.VcsException;
 -import com.intellij.openapi.vcs.changes.*;
 -import com.intellij.openapi.vcs.history.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.vcsUtil.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.*;
 +import com.intellij.openapi.vcs.changes.ContentRevision;
++import com.intellij.openapi.vcs.changes.CurrentContentRevision;
 +import com.intellij.openapi.vcs.history.VcsRevisionNumber;
 +import com.intellij.openapi.vfs.VirtualFile;
++import com.intellij.vcsUtil.VcsUtil;
 +import org.jetbrains.annotations.NotNull;
 +import org.zmlx.hg4idea.HgFile;
++import org.zmlx.hg4idea.HgRevisionNumber;
  
- class HgCurrentContentRevision implements ContentRevision {
-   private final HgFile hgFile;
+ class HgCurrentContentRevision extends CurrentContentRevision {
    private final VcsRevisionNumber revisionNumber;
-   private final VirtualFile virtualFile;
-   private FilePath filePath;
  
-   public HgCurrentContentRevision(HgFile hgFile,
-     VcsRevisionNumber revisionNumber, VirtualFile virtualFile) {
-     this.hgFile = hgFile;
+   public HgCurrentContentRevision(HgFile hgFile, VcsRevisionNumber revisionNumber, VirtualFile virtualFile) {
+     super( hgFile.toFilePath() );
      this.revisionNumber = revisionNumber;
-     this.virtualFile = virtualFile;
    }
  
-   public String getContent() throws VcsException {
-     Document doc = ApplicationManager.getApplication().runReadAction(new Computable<Document>() {
-       public Document compute() {
-         return FileDocumentManager.getInstance().getDocument(virtualFile);
-       }
-     });
-     if (doc == null) {
+   @NotNull
+   public VcsRevisionNumber getRevisionNumber() {
+     return revisionNumber;
+   }
+   public static ContentRevision create(HgFile hgFile, HgRevisionNumber revision) {
+     VirtualFile virtualFile = VcsUtil.getVirtualFile(hgFile.getFile());
+     if (virtualFile == null) {
        return null;
      }
-     return doc.getText();
-   }
  
-   @NotNull
-   public FilePath getFile() {
-     if (filePath == null) {
-       filePath = hgFile.toFilePath();
+     if (!virtualFile.getFileType().isBinary()) {
+       return new HgCurrentContentRevision(hgFile, revision, virtualFile);
      }
-     return filePath;
-   }
  
-   @NotNull
-   public VcsRevisionNumber getRevisionNumber() {
-     return revisionNumber;
+     return new HgCurrentBinaryContentRevision(hgFile, revision);
    }
  }
index 7a970f23a54ed7aeae3c5d84b7190ab2c35e5053,1e0935ac0c3b99da062f0b5324e60180e3ba756b..f94054fbf252a85356edd9d88c539f241e8126a8
  // limitations under the License.
  package org.zmlx.hg4idea.provider;
  
 -import com.intellij.openapi.project.*;
 +import com.intellij.openapi.project.Project;
+ import com.intellij.openapi.vcs.FilePath;
 -import com.intellij.openapi.vcs.changes.*;
 -import com.intellij.openapi.vcs.diff.*;
 -import com.intellij.openapi.vcs.history.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.vcsUtil.*;
 -import org.zmlx.hg4idea.*;
 -import org.zmlx.hg4idea.command.*;
 +import com.intellij.openapi.vcs.changes.ContentRevision;
 +import com.intellij.openapi.vcs.diff.DiffProvider;
 +import com.intellij.openapi.vcs.diff.ItemLatestState;
 +import com.intellij.openapi.vcs.history.VcsRevisionNumber;
- import com.intellij.openapi.vcs.FilePath;
 +import com.intellij.openapi.vfs.VfsUtil;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import com.intellij.vcsUtil.VcsUtil;
- import org.zmlx.hg4idea.HgFile;
 +import org.zmlx.hg4idea.HgContentRevision;
++import org.zmlx.hg4idea.HgFile;
 +import org.zmlx.hg4idea.HgRevisionNumber;
 +import org.zmlx.hg4idea.command.HgWorkingCopyRevisionsCommand;
  
  public class HgDiffProvider implements DiffProvider {
  
index 492a078237f16ea8a708c134b582c9f37bc69152,8b8595eff3d7a947f832ed6f5055f8a7da17d4ab..1eb8b702a1e4507cae631901e3a4ef516565b39d
  // limitations under the License.
  package org.zmlx.hg4idea.provider;
  
 -import com.intellij.openapi.actionSystem.*;
 -import com.intellij.openapi.project.*;
 +import com.intellij.openapi.actionSystem.AnAction;
 +import com.intellij.openapi.project.Project;
  import com.intellij.openapi.vcs.FilePath;
 -import com.intellij.openapi.vcs.*;
 +import com.intellij.openapi.vcs.VcsException;
  import com.intellij.openapi.vcs.history.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.util.ui.*;
 -import com.intellij.vcsUtil.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.*;
 -import org.zmlx.hg4idea.command.*;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import com.intellij.util.ui.ColumnInfo;
 +import com.intellij.vcsUtil.VcsUtil;
++import org.jetbrains.annotations.Nullable;
 +import org.zmlx.hg4idea.HgFile;
 +import org.zmlx.hg4idea.HgFileRevision;
 +import org.zmlx.hg4idea.command.HgLogCommand;
++import org.zmlx.hg4idea.command.HgWorkingCopyRevisionsCommand;
  
  import javax.swing.*;
 -import java.util.*;
++import java.util.Collections;
++import java.util.LinkedList;
 +import java.util.List;
  
  public class HgHistoryProvider implements VcsHistoryProvider {
  
index 44146fcaa9c8d0d2787cba00d714c70851f9f1a9,ff9c8938c1d8a0ec33490868a97ece3a33a44d2a..b5847aca665256dd23185ce51776dcfc165e2277
  // limitations under the License.
  package org.zmlx.hg4idea.provider;
  
 -import com.intellij.openapi.project.*;
 +import com.intellij.openapi.project.Project;
  import com.intellij.openapi.vcs.FilePath;
 -import com.intellij.openapi.vcs.*;
 -import com.intellij.openapi.vcs.changes.*;
 -import com.intellij.openapi.vcs.rollback.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.vcsUtil.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.*;
 -import org.zmlx.hg4idea.command.*;
 +import com.intellij.openapi.vcs.VcsException;
 +import com.intellij.openapi.vcs.changes.Change;
- import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
 +import com.intellij.openapi.vcs.changes.ContentRevision;
++import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
 +import com.intellij.openapi.vcs.rollback.RollbackEnvironment;
 +import com.intellij.openapi.vcs.rollback.RollbackProgressListener;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import com.intellij.vcsUtil.VcsUtil;
- import org.zmlx.hg4idea.command.HgRevertCommand;
- import org.zmlx.hg4idea.HgVcsMessages;
- import org.zmlx.hg4idea.HgFile;
 +import org.jetbrains.annotations.NotNull;
++import org.zmlx.hg4idea.HgFile;
++import org.zmlx.hg4idea.HgRevisionNumber;
++import org.zmlx.hg4idea.HgVcsMessages;
++import org.zmlx.hg4idea.command.HgResolveCommand;
++import org.zmlx.hg4idea.command.HgRevertCommand;
++import org.zmlx.hg4idea.command.HgWorkingCopyRevisionsCommand;
  
 -import java.util.*;
 +import java.util.LinkedList;
 +import java.util.List;
  
  public class HgRollbackEnvironment implements RollbackEnvironment {
  
index 865264263396a9a0f00651729db73f3b21050533,ad700de7e966e4fdbb1484cf86ab0f6d05f70b03..3c16585bc579915e4899718d7095509800fb56ff
  // limitations under the License.
  package org.zmlx.hg4idea.provider.annotate;
  
 -import com.intellij.openapi.diagnostic.*;
 -import com.intellij.openapi.vcs.*;
 -import com.intellij.openapi.vcs.annotate.*;
 -import com.intellij.openapi.vcs.changes.*;
 -import com.intellij.openapi.vcs.history.*;
 -import org.apache.commons.lang.*;
 -import org.zmlx.hg4idea.*;
 -
 -import java.util.*;
 +import com.intellij.openapi.diagnostic.Logger;
 +import com.intellij.openapi.vcs.VcsException;
 +import com.intellij.openapi.vcs.annotate.AnnotationListener;
++import com.intellij.openapi.vcs.annotate.AnnotationSourceSwitcher;
 +import com.intellij.openapi.vcs.annotate.FileAnnotation;
 +import com.intellij.openapi.vcs.annotate.LineAnnotationAspect;
- import com.intellij.openapi.vcs.annotate.AnnotationSourceSwitcher;
 +import com.intellij.openapi.vcs.changes.CurrentContentRevision;
 +import com.intellij.openapi.vcs.history.VcsFileRevision;
 +import com.intellij.openapi.vcs.history.VcsRevisionNumber;
 +import org.apache.commons.lang.StringUtils;
 +import org.zmlx.hg4idea.HgFile;
 +import org.zmlx.hg4idea.HgFileRevision;
 +
 +import java.util.LinkedList;
 +import java.util.List;
  
  public class HgAnnotation implements FileAnnotation {
  
index 4f82618b2ac60031e13ec8836e02efc698f250ba,02a99713242223558aaaf1376cb0a36b38a83a90..bc86be6c8a41de90cb89c853c123611837731e91
  // limitations under the License.
  package org.zmlx.hg4idea.provider.annotate;
  
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vcs.*;
 -import com.intellij.openapi.vcs.annotate.*;
 -import com.intellij.openapi.vcs.history.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.vcsUtil.*;
 -import org.zmlx.hg4idea.*;
 -import org.zmlx.hg4idea.command.*;
++import com.intellij.openapi.project.Project;
++import com.intellij.openapi.vcs.VcsException;
 +import com.intellij.openapi.vcs.annotate.AnnotationProvider;
 +import com.intellij.openapi.vcs.annotate.FileAnnotation;
- import com.intellij.openapi.vcs.VcsException;
 +import com.intellij.openapi.vcs.history.VcsFileRevision;
- import com.intellij.openapi.vfs.VirtualFile;
 +import com.intellij.openapi.vfs.VfsUtil;
- import com.intellij.openapi.project.Project;
++import com.intellij.openapi.vfs.VirtualFile;
 +import com.intellij.vcsUtil.VcsUtil;
++import org.zmlx.hg4idea.HgFile;
 +import org.zmlx.hg4idea.command.HgAnnotateCommand;
 +import org.zmlx.hg4idea.command.HgLogCommand;
- import org.zmlx.hg4idea.HgFile;
  
  public class HgAnnotationProvider implements AnnotationProvider {
  
index 849a3308f3b1cccaf39762929495dace89b23a7e,19995c49942e64c0a0c699d3a0a039326ba7a15f..bf6465e7c58f9aaa8e346f5f222d88fdd2390a44
  // limitations under the License.
  package org.zmlx.hg4idea.provider.commit;
  
 -import com.intellij.openapi.application.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.ui.*;
 -import com.intellij.openapi.vcs.*;
++import com.intellij.openapi.application.ApplicationManager;
++import com.intellij.openapi.application.ModalityState;
 +import com.intellij.openapi.project.Project;
++import com.intellij.openapi.ui.Messages;
 +import com.intellij.openapi.vcs.CheckinProjectPanel;
  import com.intellij.openapi.vcs.FilePath;
 -import com.intellij.openapi.vcs.changes.*;
 -import com.intellij.openapi.vcs.checkin.*;
 -import com.intellij.openapi.vcs.ui.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.vcsUtil.*;
 -import org.zmlx.hg4idea.*;
 +import com.intellij.openapi.vcs.VcsException;
 +import com.intellij.openapi.vcs.changes.Change;
 +import com.intellij.openapi.vcs.changes.ChangeList;
 +import com.intellij.openapi.vcs.changes.ContentRevision;
 +import com.intellij.openapi.vcs.checkin.CheckinEnvironment;
 +import com.intellij.openapi.vcs.ui.RefreshableOnComponent;
 +import com.intellij.openapi.vfs.VfsUtil;
 +import com.intellij.openapi.vfs.VirtualFile;
- import com.intellij.util.NullableFunction;
- import com.intellij.util.PairConsumer;
 +import com.intellij.vcsUtil.VcsUtil;
- import org.jetbrains.annotations.NotNull;
 +import org.zmlx.hg4idea.HgFile;
++import org.zmlx.hg4idea.HgRevisionNumber;
 +import org.zmlx.hg4idea.HgVcsMessages;
- import org.zmlx.hg4idea.command.HgAddCommand;
- import org.zmlx.hg4idea.command.HgCommandException;
- import org.zmlx.hg4idea.command.HgCommitCommand;
- import org.zmlx.hg4idea.command.HgRemoveCommand;
+ import org.zmlx.hg4idea.command.*;
  
- import java.util.HashMap;
- import java.util.LinkedList;
- import java.util.List;
- import java.util.Map;
+ import java.util.*;
  
  public class HgCheckinEnvironment implements CheckinEnvironment {
  
      return exceptions;
    }
  
+   private boolean isMergeCommit(VirtualFile repo) {
+     return new HgWorkingCopyRevisionsCommand(project).parents(repo).size() > 1;
+   }
+   private Set<HgFile> getChangedFilesNotInCommit(VirtualFile repo, Set<HgFile> selectedFiles) {
+     List<HgRevisionNumber> parents = new HgWorkingCopyRevisionsCommand(project).parents(repo);
+     HgStatusCommand statusCommand = new HgStatusCommand(project);
+     statusCommand.setBaseRevision(parents.get(0));
+     statusCommand.setIncludeUnknown(false);
+     statusCommand.setIncludeIgnored(false);
+     Set<HgChange> allChangedFilesInRepo = statusCommand.execute(repo);
+     Set<HgFile> filesNotIncluded = new HashSet<HgFile>();
+     for (HgChange change : allChangedFilesInRepo) {
+       HgFile beforeFile = change.beforeFile();
+       HgFile afterFile = change.afterFile();
+       if (!selectedFiles.contains(beforeFile)) {
+         filesNotIncluded.add(beforeFile);
+       } else if (!selectedFiles.contains(afterFile)) {
+         filesNotIncluded.add(afterFile);
+       }
+     }
+     return filesNotIncluded;
+   }
+   private boolean mayCommitEverything(final String filesNotIncludedString) {
+     final int[] choice = new int[1];
+     Runnable runnable = new Runnable() {
+       public void run() {
+         choice[0] = Messages.showOkCancelDialog(
+           project, 
+           HgVcsMessages.message("hg4idea.commit.partial.merge.message", filesNotIncludedString),
+           HgVcsMessages.message("hg4idea.commit.partial.merge.title"),
+           null
+         );
+       }
+     };
+     if (!ApplicationManager.getApplication().isDispatchThread()) {
+       ApplicationManager.getApplication().invokeAndWait(runnable, ModalityState.defaultModalityState());
+     } else {
+       runnable.run();
+     }
+     return choice[0] == 0;
+   }
    public List<VcsException> commit(List<Change> changes,
 -    String preparedComment, Object parameters) {
 +    String preparedComment, @NotNull NullableFunction<Object, Object> parametersHolder) {
      return commit(changes, preparedComment);
    }
  
index 8ca86fc31d4e2379daae9997530a7e5ce85bc50d,e0dd528cc63cd97b65d1022b374574c4ddfc1736..b932da944cc629163a02597eb880409339edc8fd
  // limitations under the License.
  package org.zmlx.hg4idea.provider.commit;
  
 -import com.intellij.openapi.project.*;
 +import com.intellij.openapi.project.Project;
  import com.intellij.openapi.vcs.FilePath;
 -import com.intellij.openapi.vcs.*;
 -import com.intellij.openapi.vcs.changes.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.vcsUtil.*;
 -import org.apache.commons.lang.*;
 -import org.zmlx.hg4idea.*;
 -import org.zmlx.hg4idea.command.*;
++import com.intellij.openapi.vcs.VcsException;
 +import com.intellij.openapi.vcs.changes.Change;
 +import com.intellij.openapi.vcs.changes.CommitSession;
 +import com.intellij.openapi.vcs.changes.ContentRevision;
- import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import com.intellij.vcsUtil.VcsUtil;
 +import org.apache.commons.lang.StringUtils;
++import org.zmlx.hg4idea.HgUtil;
 +import org.zmlx.hg4idea.HgVcsMessages;
 +import org.zmlx.hg4idea.command.HgCommandException;
 +import org.zmlx.hg4idea.command.HgCommitCommand;
  
- import javax.swing.JComponent;
+ import javax.swing.*;
 -import java.util.*;
 +import java.util.Collection;
 +import java.util.HashSet;
 +import java.util.Set;
  
  public class HgCommitSession implements CommitSession {
  
index 5ee68c509662343e985d78c4fdb25fc249618583,606d0ab76c2f40be72cb5950ecb9264983580c7e..ef87157937ad530e3e3745f0bbefb6087f5b7f38
  // limitations under the License.
  package org.zmlx.hg4idea.provider.update;
  
 -import com.intellij.openapi.application.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vcs.*;
 -import com.intellij.openapi.vcs.merge.*;
 -import com.intellij.openapi.vcs.update.*;
 -import com.intellij.openapi.vfs.*;
 -import com.intellij.vcsUtil.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.*;
 -import org.zmlx.hg4idea.command.*;
++import com.intellij.openapi.application.ApplicationManager;
 +import com.intellij.openapi.project.Project;
- import com.intellij.openapi.util.io.FileUtil;
 +import com.intellij.openapi.vcs.AbstractVcsHelper;
 +import com.intellij.openapi.vcs.VcsException;
 +import com.intellij.openapi.vcs.merge.MergeData;
 +import com.intellij.openapi.vcs.merge.MergeProvider;
 +import com.intellij.openapi.vcs.update.FileGroup;
 +import com.intellij.openapi.vcs.update.UpdatedFiles;
- import com.intellij.openapi.vfs.VfsUtil;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import com.intellij.vcsUtil.VcsUtil;
 +import org.jetbrains.annotations.NotNull;
 +import org.zmlx.hg4idea.HgFile;
- import org.zmlx.hg4idea.HgRevisionNumber;
 +import org.zmlx.hg4idea.HgVcs;
- import org.zmlx.hg4idea.command.HgCatCommand;
 +import org.zmlx.hg4idea.command.HgResolveCommand;
 +import org.zmlx.hg4idea.command.HgResolveStatusEnum;
  
 -import java.io.*;
 -import java.util.*;
 +import java.io.File;
- import java.io.FileInputStream;
- import java.io.IOException;
 +import java.util.ArrayList;
 +import java.util.List;
 +import java.util.Map;
  
  public final class HgConflictResolver {
  
index 1837fb790c432abbff2b4587d69049e11f2e11aa,5a31d4623dbd086c44259384fe52d4ff1a9d9a15..b1c0a3d0f28c12b955aabe26caba1813e33fc5e3
  // limitations under the License.
  package org.zmlx.hg4idea.provider.update;
  
- import com.intellij.openapi.progress.ProgressIndicator;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.vcs.*;
 -import com.intellij.openapi.vcs.history.*;
 -import com.intellij.openapi.vcs.update.*;
 -import com.intellij.openapi.vfs.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.*;
 -import org.zmlx.hg4idea.command.*;
 -
 -import java.util.*;
 -
 -import static org.zmlx.hg4idea.HgErrorHandler.*;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.vcs.VcsException;
 +import com.intellij.openapi.vcs.history.VcsRevisionNumber;
- import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
 +import com.intellij.openapi.vcs.update.FileGroup;
 +import com.intellij.openapi.vcs.update.UpdatedFiles;
 +import com.intellij.openapi.vfs.VirtualFile;
 +import org.jetbrains.annotations.NotNull;
 +import org.zmlx.hg4idea.HgFile;
- import org.zmlx.hg4idea.HgVcsMessages;
++import org.zmlx.hg4idea.HgUtil;
 +import org.zmlx.hg4idea.HgVcs;
 +import org.zmlx.hg4idea.command.HgChange;
++import org.zmlx.hg4idea.command.HgCommandResult;
 +import org.zmlx.hg4idea.command.HgMergeCommand;
 +import org.zmlx.hg4idea.command.HgStatusCommand;
 +
 +import java.util.Set;
 +
++import static org.zmlx.hg4idea.HgErrorHandler.ensureSuccess;
  final class HgHeadMerger {
  
    private final Project project;
index 339182b2817d8a6c6f772bcb2f88909fe5ce0471,380240cebfc98f1f092a7513b0e659f07eab2b8e..2be3934e75c1b14ed6e38d51cd44ae0a390dd8b7
  // limitations under the License.
  package org.zmlx.hg4idea.provider.update;
  
 -import com.intellij.openapi.application.*;
 -import com.intellij.openapi.options.*;
 -import com.intellij.openapi.progress.*;
 -import com.intellij.openapi.project.*;
 -import com.intellij.openapi.util.*;
++import com.intellij.openapi.application.ApplicationManager;
++import com.intellij.openapi.application.ModalityState;
 +import com.intellij.openapi.options.Configurable;
 +import com.intellij.openapi.progress.ProgressIndicator;
 +import com.intellij.openapi.project.Project;
 +import com.intellij.openapi.util.Ref;
  import com.intellij.openapi.vcs.FilePath;
 -import com.intellij.openapi.vcs.*;
 +import com.intellij.openapi.vcs.VcsException;
- import com.intellij.openapi.vcs.update.SequentialUpdatesContext;
- import com.intellij.openapi.vcs.update.UpdateEnvironment;
- import com.intellij.openapi.vcs.update.UpdateSession;
- import com.intellij.openapi.vcs.update.UpdateSessionAdapter;
- import com.intellij.openapi.vcs.update.UpdatedFiles;
+ import com.intellij.openapi.vcs.update.*;
 -import com.intellij.openapi.vfs.*;
 -import org.apache.commons.lang.*;
 -import org.jetbrains.annotations.*;
 -import org.zmlx.hg4idea.*;
 -import org.zmlx.hg4idea.command.*;
 -import org.zmlx.hg4idea.ui.*;
 -
 -import java.util.*;
 +import com.intellij.openapi.vfs.VirtualFile;
- import com.intellij.openapi.application.ApplicationManager;
- import com.intellij.openapi.application.ModalityState;
++import org.apache.commons.lang.StringUtils;
 +import org.jetbrains.annotations.NotNull;
- import org.zmlx.hg4idea.HgVcsMessages;
 +import org.zmlx.hg4idea.HgRevisionNumber;
++import org.zmlx.hg4idea.HgVcsMessages;
 +import org.zmlx.hg4idea.command.HgMergeCommand;
 +import org.zmlx.hg4idea.command.HgTagBranch;
- import org.zmlx.hg4idea.command.HgWorkingCopyRevisionsCommand;
 +import org.zmlx.hg4idea.ui.HgIntegrateDialog;
 +
 +import java.util.Collection;
 +import java.util.LinkedList;
 +import java.util.List;
  
  public class HgIntegrateEnvironment implements UpdateEnvironment {