Mercurial > hg > mercurial
diff mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/VcsRootBuilder.java @ 649:0b50d7952a7d
TW-23468 support tags as branches
author | Dmitry Neverov <dmitry.neverov@jetbrains.com> |
---|---|
date | Thu, 26 Sep 2013 16:28:57 +0400 |
parents | 7c017b6aa438 |
children | 1efd1846f00a |
line wrap: on
line diff
--- a/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/VcsRootBuilder.java Wed Sep 25 13:27:18 2013 +0400 +++ b/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/VcsRootBuilder.java Thu Sep 26 16:28:57 2013 +0400 @@ -1,13 +1,14 @@ package jetbrains.buildServer.buildTriggers.vcs.mercurial; -import java.io.File; -import java.io.IOException; import jetbrains.buildServer.vcs.SVcsRoot; import jetbrains.buildServer.vcs.impl.VcsRootImpl; import org.jetbrains.annotations.NotNull; import org.jmock.Expectations; import org.jmock.Mockery; +import java.io.File; +import java.io.IOException; + /** * @author dmitry.neverov */ @@ -23,6 +24,7 @@ private boolean myUncompressed = true; private File myCloneRepositoryTo; private boolean myDetectSubrepoChanges = false; + private boolean myTagsAsBranches = false; public static VcsRootBuilder vcsRoot() { return new VcsRootBuilder(); @@ -40,6 +42,7 @@ vcsRoot.addProperty(Constants.DETECT_SUBREPO_CHANGES, String.valueOf(myDetectSubrepoChanges)); if (myCloneRepositoryTo != null) vcsRoot.addProperty(Constants.SERVER_CLONE_PATH_PROP, String.valueOf(myCloneRepositoryTo.getAbsolutePath())); + vcsRoot.addProperty(Constants.USE_TAGS_AS_BRANCHES, String.valueOf(myTagsAsBranches)); return vcsRoot; } @@ -58,6 +61,7 @@ allowing(root).getProperty(with(Constants.UNCOMPRESSED_TRANSFER)); will(returnValue(null)); allowing(root).getProperty(with(Constants.USER_FOR_TAG)); will(returnValue(myUserForTag)); allowing(root).getProperty(with(Constants.DETECT_SUBREPO_CHANGES)); will(returnValue(String.valueOf(myDetectSubrepoChanges))); + allowing(root).getProperty(with(Constants.USE_TAGS_AS_BRANCHES)); will(returnValue(String.valueOf(myTagsAsBranches))); }}); if (myCloneRepositoryTo != null) { context.checking(new Expectations() {{ @@ -126,4 +130,10 @@ myDetectSubrepoChanges = detectSubrepoChanges; return this; } + + + public VcsRootBuilder withTagsEnabled(boolean useTagsAsBranches) { + myTagsAsBranches = useTagsAsBranches; + return this; + } }