use of jetbrains.buildServer.vcs.BulkPatchService.BulkPatchBuilderRequest in project teamcity-git by JetBrains.
the class BulkPatchBuilderTest method runFullPatch.
private void runFullPatch(@NotNull final VcsRoot root, @NotNull final BulkPatchBuilder patcher) throws VcsException, IOException {
final List<String> commits = new ArrayList<String>();
myCommitSupport.collectCommits(root, CheckoutRules.DEFAULT, new CommitsInfoBuilder.CommitsConsumer() {
public void consumeCommit(@NotNull CommitInfo commit) {
commits.add(commit.getVersion());
}
});
Assert.assertTrue(commits.size() > 0);
final List<BulkPatchBuilderRequest> request = new ArrayList<BulkPatchBuilderRequest>();
String prev = commits.get(0);
for (final String commit : commits) {
final String base = prev;
prev = commit;
request.add(new BulkPatchBuilderRequest() {
@Nullable
public String getFromVersion() {
return base;
}
@NotNull
public String getToVersion() {
return commit;
}
@Override
public String toString() {
return getFromVersion() + "->" + getToVersion();
}
});
}
myBulkBuilder.buildPatches(root, CheckoutRules.DEFAULT, request, patcher);
}
Aggregations