All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.intellij.openapi.vcs.ReadonlyStatusIsVisibleActivationCheck Maven / Gradle / Ivy

package com.intellij.openapi.vcs;

import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.notification.Notifications;
import com.intellij.openapi.application.ApplicationNamesInfo;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.SystemInfo;

/**
 * @author irengrig
 *         Date: 5/20/11
 *         Time: 12:33 PM
 */
public class ReadonlyStatusIsVisibleActivationCheck {
  public static void check(final Project project, final String vcsName) {
    if (SystemInfo.isUnix && "root".equals(System.getenv("USER"))) {
      Notifications.Bus.notify(new Notification(vcsName, vcsName + ": can not see read-only status",
          "You are logged as root, that's why:

- " + ApplicationNamesInfo.getInstance().getFullProductName() + " can not see read-only status of files.
" + "- All files are treated as writeable.
- Automatic file checkout on modification is impossible.", NotificationType.WARNING), project); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy