Mercurial > hg > mercurial
annotate mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/command/PushCommand.java @ 181:0ea2ad14ce97
Add local mirrors for agent checkout. To turn them on set agent property teamcity.hg.use.local.mirrors = true.
author | Dmitry Neverov <dmitry.neverov@jetbrains.com> |
---|---|
date | Tue, 01 Mar 2011 17:55:41 +0300 |
parents | 5198b02fc5e9 |
children | 643fa1236f4e e8f0eb6d4ca4 |
rev | line source |
---|---|
95 | 1 /* |
160
5198b02fc5e9
Update copyrights
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
95
diff
changeset
|
2 * Copyright 2000-2011 JetBrains s.r.o. |
95 | 3 * |
4 * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 * you may not use this file except in compliance with the License. | |
6 * You may obtain a copy of the License at | |
7 * | |
8 * http://www.apache.org/licenses/LICENSE-2.0 | |
9 * | |
10 * Unless required by applicable law or agreed to in writing, software | |
11 * distributed under the License is distributed on an "AS IS" BASIS, | |
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 * See the License for the specific language governing permissions and | |
14 * limitations under the License. | |
15 */ | |
44 | 16 package jetbrains.buildServer.buildTriggers.vcs.mercurial.command; |
17 | |
18 import com.intellij.execution.configurations.GeneralCommandLine; | |
19 import jetbrains.buildServer.ExecResult; | |
20 import jetbrains.buildServer.vcs.VcsException; | |
21 import org.jetbrains.annotations.NotNull; | |
22 | |
181
0ea2ad14ce97
Add local mirrors for agent checkout. To turn them on set agent property teamcity.hg.use.local.mirrors = true.
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
160
diff
changeset
|
23 import java.io.File; |
0ea2ad14ce97
Add local mirrors for agent checkout. To turn them on set agent property teamcity.hg.use.local.mirrors = true.
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
160
diff
changeset
|
24 |
44 | 25 /** |
26 * @author pavel | |
27 */ | |
28 public class PushCommand extends BaseCommand { | |
57 | 29 private boolean myForced; |
30 | |
181
0ea2ad14ce97
Add local mirrors for agent checkout. To turn them on set agent property teamcity.hg.use.local.mirrors = true.
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
160
diff
changeset
|
31 public PushCommand(@NotNull Settings settings, @NotNull File workingDir) { |
0ea2ad14ce97
Add local mirrors for agent checkout. To turn them on set agent property teamcity.hg.use.local.mirrors = true.
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
160
diff
changeset
|
32 super(settings, workingDir); |
44 | 33 } |
34 | |
57 | 35 public void setForce(boolean force) { |
36 myForced = force; | |
37 } | |
38 | |
44 | 39 public void execute() throws VcsException { |
40 GeneralCommandLine cli = createCommandLine(); | |
41 cli.addParameter("push"); | |
57 | 42 if (myForced) { |
43 cli.addParameter("-f"); | |
44 } | |
67
e6971dc6b17c
always use url with credentials if username/password are specified
Pavel.Sher
parents:
57
diff
changeset
|
45 cli.addParameter(getSettings().getRepositoryUrl()); |
44 | 46 ExecResult res = runCommand(cli); |
47 failIfNotEmptyStdErr(cli, res); | |
48 } | |
49 } |