Mercurial > hg > mercurial
comparison mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/VcsRootBuilder.java @ 276:8c10f5cec37d
TW-17797 Fix merge-base calculation
Add MergeBaseCommand and 2 its implementations. Implementation for hg
1.7+ uses revsets to get last common ancestors. Implementation for hg
<1.7 calculates merge-base manually using information about parents.
author | Dmitry Neverov <dmitry.neverov@jetbrains.com> |
---|---|
date | Thu, 04 Aug 2011 12:04:38 +0400 |
parents | 13f3e7d0c42c |
children | 8c1fd2e565ae |
comparison
equal
deleted
inserted
replaced
275:13f3e7d0c42c | 276:8c10f5cec37d |
---|---|
11 public class VcsRootBuilder { | 11 public class VcsRootBuilder { |
12 | 12 |
13 private String myRepository; | 13 private String myRepository; |
14 private String myUsername; | 14 private String myUsername; |
15 private String myPassword; | 15 private String myPassword; |
16 private String myBranch; | |
16 private long myRootId = 1L; | 17 private long myRootId = 1L; |
17 | 18 |
18 public VcsRootImpl build() throws IOException { | 19 public VcsRootImpl build() throws IOException { |
19 VcsRootImpl vcsRoot = new VcsRootImpl(1, Constants.VCS_NAME); | 20 VcsRootImpl vcsRoot = new VcsRootImpl(1, Constants.VCS_NAME); |
20 vcsRoot.addProperty(Constants.REPOSITORY_PROP, myRepository); | 21 vcsRoot.addProperty(Constants.REPOSITORY_PROP, myRepository); |
21 vcsRoot.addProperty(Constants.HG_COMMAND_PATH_PROP, Util.getHgPath()); | 22 vcsRoot.addProperty(Constants.HG_COMMAND_PATH_PROP, Util.getHgPath()); |
22 vcsRoot.addProperty(Constants.USERNAME, myUsername); | 23 vcsRoot.addProperty(Constants.USERNAME, myUsername); |
23 vcsRoot.addProperty(Constants.PASSWORD, myPassword); | 24 vcsRoot.addProperty(Constants.PASSWORD, myPassword); |
25 vcsRoot.addProperty(Constants.BRANCH_NAME_PROP, myBranch); | |
24 return vcsRoot; | 26 return vcsRoot; |
25 } | 27 } |
26 | 28 |
27 | 29 |
28 public VcsRootBuilder repository(@NotNull String repository) { | 30 public VcsRootBuilder repository(@NotNull String repository) { |
41 myPassword = password; | 43 myPassword = password; |
42 return this; | 44 return this; |
43 } | 45 } |
44 | 46 |
45 | 47 |
48 public VcsRootBuilder branch(@NotNull String branch) { | |
49 myBranch = branch; | |
50 return this; | |
51 } | |
52 | |
53 | |
46 public VcsRootBuilder rootId(long rootId) { | 54 public VcsRootBuilder rootId(long rootId) { |
47 myRootId = rootId; | 55 myRootId = rootId; |
48 return this; | 56 return this; |
49 } | 57 } |
50 } | 58 } |