dmitry@732: /* dmitry@732: * Copyright 2000-2014 JetBrains s.r.o. dmitry@732: * dmitry@732: * Licensed under the Apache License, Version 2.0 (the "License"); dmitry@732: * you may not use this file except in compliance with the License. dmitry@732: * You may obtain a copy of the License at dmitry@732: * dmitry@732: * http://www.apache.org/licenses/LICENSE-2.0 dmitry@732: * dmitry@732: * Unless required by applicable law or agreed to in writing, software dmitry@732: * distributed under the License is distributed on an "AS IS" BASIS, dmitry@732: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. dmitry@732: * See the License for the specific language governing permissions and dmitry@732: * limitations under the License. dmitry@732: */ dmitry@732: dmitry@280: package jetbrains.buildServer.buildTriggers.vcs.mercurial.command; dmitry@280: dmitry@280: import org.jetbrains.annotations.NotNull; dmitry@280: dmitry@280: import java.io.File; dmitry@280: import java.util.Collections; dmitry@280: import java.util.Set; dmitry@280: dmitry@790: import static jetbrains.buildServer.util.CollectionsUtil.setOf; dmitry@790: dmitry@280: /** dmitry@280: * @author dmitry.neverov dmitry@280: */ dmitry@280: public class VcsRootCommand extends BaseCommand { dmitry@280: dmitry@399: protected final AuthSettings myAuthSettings; dmitry@280: dmitry@480: public VcsRootCommand(@NotNull CommandSettings commandSettings, dmitry@480: @NotNull String hgPath, dmitry@480: @NotNull File workingDir, dmitry@480: @NotNull AuthSettings authSettings) { dmitry@480: super(commandSettings, hgPath, workingDir); dmitry@399: myAuthSettings = authSettings; dmitry@280: } dmitry@280: eugene@777: @NotNull dmitry@369: protected Set getPrivateData() { dmitry@399: String password = myAuthSettings.getPassword(); dmitry@790: if (password == null) dmitry@790: return Collections.emptySet(); dmitry@790: return setOf(password, AuthSettings.escapePassword(password)); dmitry@304: } dmitry@280: }