// Path: src/org/github/irengrig/fossil4idea/FossilVcs.java
// public class FossilVcs extends AbstractVcs {
//   public static String NAME = "fossil";
//   public static String DISPLAY_NAME = "Fossil";
//   private FossilChangeProvider myChangeProvider;
//   private static final VcsKey ourKey = createKey(NAME);
//   private FossilVfsListener myVfsListener;
//   private UiManager uiManager;
//   private FossilCheckinEnvironment fossilCheckinEnvironment;
// 
//   public FossilVcs(Project project) {
//     super(project, NAME);
//   }
// 
//   @Override
//   public String getDisplayName() {
//     return DISPLAY_NAME;
//   }
// 
//   @Override
//   public Configurable getConfigurable() {
//     return new FossilConfigurable(myProject);
//   }
// 
//   @Override
//   protected void activate() {
//     myVfsListener = new FossilVfsListener(myProject);
//     uiManager = new UiManager(myProject);
//   }
// 
//   @Override
//   protected void deactivate() {
//     if (myVfsListener != null) {
//       Disposer.dispose(myVfsListener);
//       myVfsListener = null;
//       uiManager.stop();
//     }
//   }
// 
//   public UiManager getUiManager() {
//     return uiManager;
//   }
// 
//   @Nullable
//   @Override
//   public ChangeProvider getChangeProvider() {
//     if (myChangeProvider == null) {
//       myChangeProvider = new FossilChangeProvider(myProject);
//     }
//     return myChangeProvider;
//   }
// 
//   @Nullable
//   @Override
//   protected CheckinEnvironment createCheckinEnvironment() {
//     if (fossilCheckinEnvironment == null) {
//       fossilCheckinEnvironment = new FossilCheckinEnvironment(this);
//     }
//     return fossilCheckinEnvironment;
//   }
// 
//   @Nullable
//   @Override
//   protected RollbackEnvironment createRollbackEnvironment() {
//     return new FossilRollbackEnvironment(this);
//   }
// 
//   @Nullable
//   @Override
//   public VcsHistoryProvider getVcsHistoryProvider() {
//     return new FossilHistoryProvider(this);
//   }
// 
//   @Nullable
//   @Override
//   protected UpdateEnvironment createUpdateEnvironment() {
//     return new FossilUpdateEnvironment(this);
//   }
// 
//   @Override
//   public List<CommitExecutor> getCommitExecutors() {
//     return Collections.<CommitExecutor>singletonList(new FossilCommitAndPushExecutor(myProject));
//   }
// 
//   public void checkVersion() {
//     //todo
//   }
// 
//   @Nullable
//   @Override
//   public DiffProvider getDiffProvider() {
//     return new FossilDiffProvider(this);
//   }
// 
//   public static FossilVcs getInstance(final Project project) {
//     return (FossilVcs) ProjectLevelVcsManager.getInstance(project).findVcsByName(NAME);
//   }
// 
//   public static VcsKey getVcsKey() {
//     return ourKey;
//   }
// 
//   @Nullable
//   @Override
//   public AnnotationProvider getAnnotationProvider() {
//     return new FossilAnnotationProvider(this);
//   }
// }
// 
// Path: src/org/github/irengrig/fossil4idea/FossilConfiguration.java
// @State(
//     name = "FossilConfiguration",
//     storages = {
//         @Storage(file = StoragePathMacros.WORKSPACE_FILE)
//     }
// )
// public class FossilConfiguration implements PersistentStateComponent<Element> {
//   public String FOSSIL_PATH = "";
//   private final Map<File, String> myRemoteUrls = new HashMap<File, String>();
// 
//   @Nullable
//   public Element getState() {
//     Element element = new Element("state");
//     element.setAttribute("FOSSIL_PATH", FOSSIL_PATH);
//     return element;
//   }
// 
//   public void loadState(Element element) {
//     final Attribute fossilPath = element.getAttribute("FOSSIL_PATH");
//     if (fossilPath != null) {
//       FOSSIL_PATH = fossilPath.getValue();
//     }
//   }
// 
//   public static FossilConfiguration getInstance(final Project project) {
//     return ServiceManager.getService(project, FossilConfiguration.class);
//   }
// 
//   public void setRemoteUrls(final Map<File, String> urls) {
//     myRemoteUrls.clear();
//     myRemoteUrls.putAll(urls);
//   }
// 
//   public Map<File, String> getRemoteUrls() {
//     return myRemoteUrls;
//   }
// }


import com.intellij.execution.ExecutionException;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.ProcessEventListener;
import com.intellij.util.EventDispatcher;
import com.intellij.util.Processor;
import org.github.irengrig.fossil4idea.FossilVcs;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.github.irengrig.fossil4idea.FossilConfiguration;
import java.io.File;
import java.io.OutputStream;
import java.util.List;
      return myCanceled;
    }
  }

  public void cancel() {
    synchronized (myLock) {
      myCanceled = true;
      checkStarted();
      destroyProcess();
    }
  }

  protected void setExitCode(final int code) {
    synchronized (myLock) {
      myExitCode = code;
    }
  }

  public void addListener(final ProcessEventListener listener) {
    synchronized (myLock) {
      myListeners.addListener(listener);
    }
  }

  protected ProcessEventListener listeners() {
    synchronized (myLock) {
      return myListeners.getMulticaster();
    }
  }

// Path: src/org/github/irengrig/fossil4idea/FossilVcs.java
// public class FossilVcs extends AbstractVcs {
//   public static String NAME = "fossil";
//   public static String DISPLAY_NAME = "Fossil";
//   private FossilChangeProvider myChangeProvider;
//   private static final VcsKey ourKey = createKey(NAME);
//   private FossilVfsListener myVfsListener;
//   private UiManager uiManager;
//   private FossilCheckinEnvironment fossilCheckinEnvironment;
// 
//   public FossilVcs(Project project) {
//     super(project, NAME);
//   }
// 
//   @Override
//   public String getDisplayName() {
//     return DISPLAY_NAME;
//   }
// 
//   @Override
//   public Configurable getConfigurable() {
//     return new FossilConfigurable(myProject);
//   }
// 
//   @Override
//   protected void activate() {
//     myVfsListener = new FossilVfsListener(myProject);
//     uiManager = new UiManager(myProject);
//   }
// 
//   @Override
//   protected void deactivate() {
//     if (myVfsListener != null) {
//       Disposer.dispose(myVfsListener);
//       myVfsListener = null;
//       uiManager.stop();
//     }
//   }
// 
//   public UiManager getUiManager() {
//     return uiManager;
//   }
// 
//   @Nullable
//   @Override
//   public ChangeProvider getChangeProvider() {
//     if (myChangeProvider == null) {
//       myChangeProvider = new FossilChangeProvider(myProject);
//     }
//     return myChangeProvider;
//   }
// 
//   @Nullable
//   @Override
//   protected CheckinEnvironment createCheckinEnvironment() {
//     if (fossilCheckinEnvironment == null) {
//       fossilCheckinEnvironment = new FossilCheckinEnvironment(this);
//     }
//     return fossilCheckinEnvironment;
//   }
// 
//   @Nullable
//   @Override
//   protected RollbackEnvironment createRollbackEnvironment() {
//     return new FossilRollbackEnvironment(this);
//   }
// 
//   @Nullable
//   @Override
//   public VcsHistoryProvider getVcsHistoryProvider() {
//     return new FossilHistoryProvider(this);
//   }
// 
//   @Nullable
//   @Override
//   protected UpdateEnvironment createUpdateEnvironment() {
//     return new FossilUpdateEnvironment(this);
//   }
// 
//   @Override
//   public List<CommitExecutor> getCommitExecutors() {
//     return Collections.<CommitExecutor>singletonList(new FossilCommitAndPushExecutor(myProject));
//   }
// 
//   public void checkVersion() {
//     //todo
//   }
// 
//   @Nullable
//   @Override
//   public DiffProvider getDiffProvider() {
//     return new FossilDiffProvider(this);
//   }
// 
//   public static FossilVcs getInstance(final Project project) {
//     return (FossilVcs) ProjectLevelVcsManager.getInstance(project).findVcsByName(NAME);
//   }
// 
//   public static VcsKey getVcsKey() {
//     return ourKey;
//   }
// 
//   @Nullable
//   @Override
//   public AnnotationProvider getAnnotationProvider() {
//     return new FossilAnnotationProvider(this);
//   }
// }
// 
// Path: src/org/github/irengrig/fossil4idea/FossilConfiguration.java
// @State(
//     name = "FossilConfiguration",
//     storages = {
//         @Storage(file = StoragePathMacros.WORKSPACE_FILE)
//     }
// )
// public class FossilConfiguration implements PersistentStateComponent<Element> {
//   public String FOSSIL_PATH = "";
//   private final Map<File, String> myRemoteUrls = new HashMap<File, String>();
// 
//   @Nullable
//   public Element getState() {
//     Element element = new Element("state");
//     element.setAttribute("FOSSIL_PATH", FOSSIL_PATH);
//     return element;
//   }
// 
//   public void loadState(Element element) {
//     final Attribute fossilPath = element.getAttribute("FOSSIL_PATH");
//     if (fossilPath != null) {
//       FOSSIL_PATH = fossilPath.getValue();
//     }
//   }
// 
//   public static FossilConfiguration getInstance(final Project project) {
//     return ServiceManager.getService(project, FossilConfiguration.class);
//   }
// 
//   public void setRemoteUrls(final Map<File, String> urls) {
//     myRemoteUrls.clear();
//     myRemoteUrls.putAll(urls);
//   }
// 
//   public Map<File, String> getRemoteUrls() {
//     return myRemoteUrls;
//   }
// }


// Path: src/org/github/irengrig/fossil4idea/commandLine/FossilCommand.java
import com.intellij.execution.ExecutionException;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.ProcessEventListener;
import com.intellij.util.EventDispatcher;
import com.intellij.util.Processor;
import org.github.irengrig.fossil4idea.FossilVcs;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.github.irengrig.fossil4idea.FossilConfiguration;
import java.io.File;
import java.io.OutputStream;
import java.util.List;

      return myCanceled;
    }
  }

  public void cancel() {
    synchronized (myLock) {
      myCanceled = true;
      checkStarted();
      destroyProcess();
    }
  }

  protected void setExitCode(final int code) {
    synchronized (myLock) {
      myExitCode = code;
    }
  }

  public void addListener(final ProcessEventListener listener) {
    synchronized (myLock) {
      myListeners.addListener(listener);
    }
  }

  protected ProcessEventListener listeners() {
    synchronized (myLock) {
      return myListeners.getMulticaster();
    }
  }

  public void addParameters(@NonNls @NotNull String... parameters) {