use of org.apache.maven.scm.provider.ScmProviderRepository in project maven-scm by apache.
the class HgChangeLogCommand method executeChangeLogCommand.
/**
* {@inheritDoc}
*/
@Override
protected ChangeLogScmResult executeChangeLogCommand(ChangeLogScmRequest request) throws ScmException {
final ScmVersion startVersion = request.getStartRevision();
final ScmVersion endVersion = request.getEndRevision();
final ScmFileSet fileSet = request.getScmFileSet();
final String datePattern = request.getDatePattern();
if (startVersion != null || endVersion != null) {
final ScmProviderRepository scmProviderRepository = request.getScmRepository().getProviderRepository();
return executeChangeLogCommand(scmProviderRepository, fileSet, startVersion, endVersion, datePattern);
}
return executeChangeLogCommand(fileSet, request.getStartDate(), request.getEndDate(), datePattern, request.getLimit());
}
use of org.apache.maven.scm.provider.ScmProviderRepository in project maven-scm by apache.
the class GitInfoCommandTckTest method testInfoCommandWithNegativeShortRevision.
public void testInfoCommandWithNegativeShortRevision() throws Exception {
GitScmTestUtils.initRepo("src/test/resources/git/info", getRepositoryRoot(), getWorkingCopy());
ScmProvider provider = getScmManager().getProviderByUrl(getScmUrl());
ScmProviderRepository repository = provider.makeProviderScmRepository(getRepositoryRoot());
assertNotNull(repository);
CommandParameters commandParameters = new CommandParameters();
commandParameters.setInt(CommandParameter.SCM_SHORT_REVISION_LENGTH, GitInfoCommand.NO_REVISION_LENGTH);
InfoScmResult result = provider.info(repository, new ScmFileSet(getRepositoryRoot()), commandParameters);
assertNotNull(result);
assertEquals("revision should not be short", "cd3c0dfacb65955e6fbb35c56cc5b1bf8ce4f767", result.getInfoItems().get(0).getRevision());
}
use of org.apache.maven.scm.provider.ScmProviderRepository in project maven-scm by apache.
the class GitInfoCommandTckTest method testInfoCommandWithShortRevision.
public void testInfoCommandWithShortRevision() throws Exception {
GitScmTestUtils.initRepo("src/test/resources/git/info", getRepositoryRoot(), getWorkingCopy());
ScmProvider provider = getScmManager().getProviderByUrl(getScmUrl());
ScmProviderRepository repository = provider.makeProviderScmRepository(getRepositoryRoot());
assertNotNull(repository);
CommandParameters commandParameters = new CommandParameters();
commandParameters.setInt(CommandParameter.SCM_SHORT_REVISION_LENGTH, 6);
InfoScmResult result = provider.info(repository, new ScmFileSet(getRepositoryRoot()), commandParameters);
assertNotNull(result);
assertEquals("revision must be short, exactly 6 digits ", "cd3c0d", result.getInfoItems().get(0).getRevision());
}
use of org.apache.maven.scm.provider.ScmProviderRepository in project maven-scm by apache.
the class GitInfoCommandTckTest method testInfoCommand.
public void testInfoCommand() throws Exception {
GitScmTestUtils.initRepo("src/test/resources/git/info", getRepositoryRoot(), getWorkingCopy());
ScmProvider provider = getScmManager().getProviderByUrl(getScmUrl());
ScmProviderRepository repository = provider.makeProviderScmRepository(getRepositoryRoot());
assertNotNull(repository);
InfoScmResult result = provider.info(repository, new ScmFileSet(getRepositoryRoot()), new CommandParameters());
assertNotNull(result);
assertEquals("cd3c0dfacb65955e6fbb35c56cc5b1bf8ce4f767", result.getInfoItems().get(0).getRevision());
//
}
use of org.apache.maven.scm.provider.ScmProviderRepository in project maven-scm by apache.
the class GitInfoCommandTckTest method testInfoCommandWithZeroShortRevision.
public void testInfoCommandWithZeroShortRevision() throws Exception {
GitScmTestUtils.initRepo("src/test/resources/git/info", getRepositoryRoot(), getWorkingCopy());
ScmProvider provider = getScmManager().getProviderByUrl(getScmUrl());
ScmProviderRepository repository = provider.makeProviderScmRepository(getRepositoryRoot());
assertNotNull(repository);
CommandParameters commandParameters = new CommandParameters();
commandParameters.setInt(CommandParameter.SCM_SHORT_REVISION_LENGTH, 0);
InfoScmResult result = provider.info(repository, new ScmFileSet(getRepositoryRoot()), commandParameters);
assertNotNull(result);
assertTrue("revision should be not empty, minimum 4 (see git help rev-parse --short)", result.getInfoItems().get(0).getRevision().length() >= 4);
}
Aggregations