// Path: src/org/github/irengrig/fossil4idea/util/FossilUtils.java
// public class FossilUtils {
//     public static final Convertor<FilePath, File> FILE_PATH_FILE_CONVERTOR = new Convertor<FilePath, File>() {
//       @Override
//       public File convert(final FilePath filePath) {
//         return filePath.getIOFile();
//       }
//     };
// 
//   public static <T> List<T> ensureList(@NotNull final Collection<T> coll) {
//     return coll instanceof List ? (List<T>) coll : new ArrayList<T>(coll);
//   }
// }
// 
// 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);
//   }
// }


import com.intellij.openapi.ui.MessageType;
import com.intellij.openapi.ui.popup.util.PopupUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.CheckinProjectPanel;
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.ObjectsConvertor;
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.ChangesUtil;
import com.intellij.openapi.vcs.checkin.CheckinEnvironment;
import com.intellij.openapi.vcs.ui.RefreshableOnComponent;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.FunctionUtil;
import com.intellij.util.NullableFunction;
import com.intellij.util.PairConsumer;
import com.intellij.util.containers.Convertor;
import org.github.irengrig.fossil4idea.util.FossilUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.github.irengrig.fossil4idea.FossilVcs;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
package org.github.irengrig.fossil4idea.checkin;



/**
 * Created with IntelliJ IDEA.
 * User: Irina.Chernushina
 * Date: 2/14/13
 * Time: 6:52 PM
 */
public class FossilCheckinEnvironment implements CheckinEnvironment {
  private final FossilVcs myFossilVcs;
  // don't like it, but because of platform design
  private boolean myPush;

// Path: src/org/github/irengrig/fossil4idea/util/FossilUtils.java
// public class FossilUtils {
//     public static final Convertor<FilePath, File> FILE_PATH_FILE_CONVERTOR = new Convertor<FilePath, File>() {
//       @Override
//       public File convert(final FilePath filePath) {
//         return filePath.getIOFile();
//       }
//     };
// 
//   public static <T> List<T> ensureList(@NotNull final Collection<T> coll) {
//     return coll instanceof List ? (List<T>) coll : new ArrayList<T>(coll);
//   }
// }
// 
// 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/checkin/FossilCheckinEnvironment.java
import com.intellij.openapi.ui.MessageType;
import com.intellij.openapi.ui.popup.util.PopupUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.CheckinProjectPanel;
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.ObjectsConvertor;
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.ChangesUtil;
import com.intellij.openapi.vcs.checkin.CheckinEnvironment;
import com.intellij.openapi.vcs.ui.RefreshableOnComponent;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.FunctionUtil;
import com.intellij.util.NullableFunction;
import com.intellij.util.PairConsumer;
import com.intellij.util.containers.Convertor;
import org.github.irengrig.fossil4idea.util.FossilUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.github.irengrig.fossil4idea.FossilVcs;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

package org.github.irengrig.fossil4idea.checkin;



/**
 * Created with IntelliJ IDEA.
 * User: Irina.Chernushina
 * Date: 2/14/13
 * Time: 6:52 PM
 */
public class FossilCheckinEnvironment implements CheckinEnvironment {
  private final FossilVcs myFossilVcs;
  // don't like it, but because of platform design
  private boolean myPush;

  public FossilCheckinEnvironment(final FossilVcs fossilVcs) {