예제 #1
0
 public SVNLogClient createLogClient() {
   final SVNLogClient client = new SVNLogClient(getPool(), myConfiguration.getOptions(myProject));
   client
       .getOperationsFactory()
       .setAuthenticationManager(myConfiguration.getAuthenticationManager(this));
   return client;
 }
예제 #2
0
 public SVNStatusClient createStatusClient() {
   SVNStatusClient client = new SVNStatusClient(getPool(), myConfiguration.getOptions(myProject));
   client
       .getOperationsFactory()
       .setAuthenticationManager(myConfiguration.getAuthenticationManager(this));
   client.setIgnoreExternals(false);
   return client;
 }
예제 #3
0
 private void createPool() {
   if (myPool != null) return;
   final String property = System.getProperty(KEEP_CONNECTIONS_KEY);
   final boolean keep;
   boolean unitTestMode = ApplicationManager.getApplication().isUnitTestMode();
   // pool variant by default
   if (StringUtil.isEmptyOrSpaces(property) || unitTestMode) {
     keep = !unitTestMode; // default
   } else {
     keep = Boolean.getBoolean(KEEP_CONNECTIONS_KEY);
   }
   myPool =
       new SvnIdeaRepositoryPoolManager(
           false,
           myConfiguration.getAuthenticationManager(this),
           myConfiguration.getOptions(myProject));
 }
예제 #4
0
  public void postStartup() {
    if (myProject.isDefault()) return;
    myCopiesRefreshManager =
        new SvnCopiesRefreshManager((SvnFileUrlMappingImpl) getSvnFileUrlMapping());
    if (!myConfiguration.isCleanupRun()) {
      ApplicationManager.getApplication()
          .invokeLater(
              new Runnable() {
                @Override
                public void run() {
                  cleanup17copies();
                  myConfiguration.setCleanupRun(true);
                }
              },
              ModalityState.NON_MODAL,
              myProject.getDisposed());
    } else {
      invokeRefreshSvnRoots();
    }

    myWorkingCopiesContent.activate();
  }
예제 #5
0
 public ISVNAuthenticationManager getSvnAuthenticationManager() {
   return myConfiguration.getAuthenticationManager(this);
 }
예제 #6
0
 public ISVNOptions getSvnOptions() {
   return myConfiguration.getOptions(myProject);
 }
예제 #7
0
 public SVNWCClient createWCClient(@NotNull ISVNAuthenticationManager manager) {
   final SVNWCClient client = new SVNWCClient(getPool(), myConfiguration.getOptions(myProject));
   client.getOperationsFactory().setAuthenticationManager(manager);
   return client;
 }
예제 #8
0
 public SVNRepository createRepository(SVNURL url) throws SVNException {
   SVNRepository repos = SVNRepositoryFactory.create(url);
   repos.setAuthenticationManager(myConfiguration.getAuthenticationManager(this));
   repos.setTunnelProvider(myConfiguration.getOptions(myProject));
   return repos;
 }
예제 #9
0
  @Override
  public void activate() {
    createPool();
    final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject);
    if (!myProject.isDefault()) {
      ChangeListManager.getInstance(myProject).addChangeListListener(myChangeListListener);
      vcsManager.addVcsListener(myVcsListener);
    }

    SvnApplicationSettings.getInstance().svnActivated();
    if (myEntriesFileListener != null) {
      VirtualFileManager.getInstance().addVirtualFileListener(myEntriesFileListener);
    }
    // this will initialize its inner listener for committed changes upload
    LoadedRevisionsCache.getInstance(myProject);
    FrameStateManager.getInstance().addListener(myFrameStateListener);

    myAuthNotifier.init();
    mySvnBranchPointsCalculator = new SvnBranchPointsCalculator(myProject);
    mySvnBranchPointsCalculator.activate();

    if (SystemInfo.isWindows) {
      if (!SVNJNAUtil.isJNAPresent()) {
        Notifications.Bus.notify(
            new Notification(
                getDisplayName(),
                "Subversion plugin: no JNA",
                "A problem with JNA initialization for svnkit library. Encryption is not available.",
                NotificationType.WARNING),
            NotificationDisplayType.BALLOON,
            myProject);
      } else if (!SVNJNAUtil.isWinCryptEnabled()) {
        Notifications.Bus.notify(
            new Notification(
                getDisplayName(),
                "Subversion plugin: no encryption",
                "A problem with encryption module (Crypt32.dll) initialization for svnkit library. Encryption is not available.",
                NotificationType.WARNING),
            NotificationDisplayType.BALLOON,
            myProject);
      }
    }

    final SvnConfiguration.UseAcceleration accelerationType =
        SvnConfiguration.getInstance(myProject).myUseAcceleration;
    if (SvnConfiguration.UseAcceleration.javaHL.equals(accelerationType)) {
      CheckJavaHL.runtimeCheck(myProject);
    } else if (SvnConfiguration.UseAcceleration.commandLine.equals(accelerationType)
        && !ApplicationManager.getApplication().isHeadlessEnvironment()) {
      myChecker.checkExecutableAndNotifyIfNeeded();
    }

    // do one time after project loaded
    StartupManager.getInstance(myProject)
        .runWhenProjectIsInitialized(
            new DumbAwareRunnable() {
              @Override
              public void run() {
                postStartup();

                // for IDEA, it takes 2 minutes - and anyway this can be done in background, no
                // sense...
                // once it could be mistaken about copies for 2 minutes on start...

                /*if (! myMapping.getAllWcInfos().isEmpty()) {
                  invokeRefreshSvnRoots();
                  return;
                }
                ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
                  public void run() {
                    myCopiesRefreshManager.getCopiesRefresh().ensureInit();
                  }
                }, SvnBundle.message("refreshing.working.copies.roots.progress.text"), true, myProject);*/
              }
            });

    vcsManager.addVcsListener(myRootsToWorkingCopies);

    myLoadedBranchesStorage.activate();
  }
예제 #10
0
  public SvnVcs(
      final Project project,
      MessageBus bus,
      SvnConfiguration svnConfiguration,
      final SvnLoadedBrachesStorage storage) {
    super(project, VCS_NAME);
    myLoadedBranchesStorage = storage;
    LOG.debug("ct");
    myRootsToWorkingCopies = new RootsToWorkingCopies(this);
    myConfiguration = svnConfiguration;
    myAuthNotifier = new SvnAuthenticationNotifier(this);

    dumpFileStatus(FileStatus.ADDED);
    dumpFileStatus(FileStatus.DELETED);
    dumpFileStatus(FileStatus.MERGE);
    dumpFileStatus(FileStatus.MODIFIED);
    dumpFileStatus(FileStatus.NOT_CHANGED);
    dumpFileStatus(FileStatus.UNKNOWN);

    dumpFileStatus(SvnFileStatus.REPLACED);
    dumpFileStatus(SvnFileStatus.EXTERNAL);
    dumpFileStatus(SvnFileStatus.OBSTRUCTED);

    refreshSSLProperty();

    final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project);
    myAddConfirmation =
        vcsManager.getStandardConfirmation(VcsConfiguration.StandardConfirmation.ADD, this);
    myDeleteConfirmation =
        vcsManager.getStandardConfirmation(VcsConfiguration.StandardConfirmation.REMOVE, this);
    myCheckoutOptions =
        vcsManager.getStandardOption(VcsConfiguration.StandardOption.CHECKOUT, this);

    if (myProject.isDefault()) {
      myChangeListListener = null;
      myEntriesFileListener = null;
    } else {
      myEntriesFileListener = new SvnEntriesFileListener(project);
      upgradeIfNeeded(bus);

      myChangeListListener = new SvnChangelistListener(myProject, this);

      myVcsListener =
          new VcsListener() {
            @Override
            public void directoryMappingChanged() {
              invokeRefreshSvnRoots();
            }
          };
    }

    myFrameStateListener =
        project.isDefault()
            ? null
            : new MyFrameStateListener(
                ChangeListManager.getInstance(project), VcsDirtyScopeManager.getInstance(project));
    myWorkingCopiesContent = new WorkingCopiesContent(this);

    // remove used some time before old notification group ids
    correctNotificationIds();
    myChecker = new SvnExecutableChecker(myProject);
    myConfiguration.getAuthenticationManager(this).setHelper(myHelper);
  }
예제 #11
0
 public SVNWCAccess createWCAccess() {
   final SVNWCAccess access = SVNWCAccess.newInstance(null);
   access.setOptions(myConfiguration.getOptions(myProject));
   return access;
 }