Mercurial > hg > mercurial
view mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/command/BaseCommand.java @ 380:3bc8125671b8
Merge branch Eluru-6.5.x
author | Dmitry Neverov <dmitry.neverov@jetbrains.com> |
---|---|
date | Wed, 15 Feb 2012 13:23:53 +0400 |
parents | 0b2e9154d26e 55c2c88a2d82 |
children | 45f25ca68312 |
line wrap: on
line source
/* * Copyright 2000-2011 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 jetbrains.buildServer.buildTriggers.vcs.mercurial.command; import com.intellij.execution.configurations.GeneralCommandLine; import org.jetbrains.annotations.NotNull; import java.io.File; import java.util.Set; import static java.util.Collections.emptySet; /** * @author pavel */ public class BaseCommand { private final String myHgPath; private final File myWorkDirectory; public BaseCommand(@NotNull final String hgPath, @NotNull File workingDir) { myHgPath = hgPath; myWorkDirectory = workingDir; } public File getWorkDirectory() { return myWorkDirectory; } protected GeneralCommandLine createCommandLine() { GeneralCommandLine cli = createCL(); cli.setWorkDirectory(myWorkDirectory.getAbsolutePath()); cli.setPassParentEnvs(true); return cli; } protected GeneralCommandLine createCL() { GeneralCommandLine cl = new MercurialCommandLine(getPrivateData()); cl.setExePath(myHgPath); return cl; } protected Set<String> getPrivateData() { return emptySet(); } }