diff options
author | Olivier Lamy <olamy@apache.org> | 2012-09-18 22:02:17 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-09-18 22:02:17 +0000 |
commit | 65768e87199f3c85099da42da1a51d40638bf4c3 (patch) | |
tree | 2a1785bd8ff8998e42f93f9da0d8207b5bdac877 | |
parent | 06acdc5d5947aea361f3e7e7d57edc45ab0d40dd (diff) | |
download | archiva-65768e87199f3c85099da42da1a51d40638bf4c3.tar.gz archiva-65768e87199f3c85099da42da1a51d40638bf4c3.zip |
method must received both source and target repo to avoid the ugly -stage to be done in the service
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1387386 13f79535-47bb-0310-9956-ffa450edef68
3 files changed, 8 insertions, 8 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/MergeRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/MergeRepositoriesService.java index 6ad8326d6..4bc02ab0e 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/MergeRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/MergeRepositoriesService.java @@ -37,7 +37,7 @@ import java.util.List; @Path ( "/mergeRepositoriesService/" ) public interface MergeRepositoriesService { - @Path ( "mergeConflictedArtifacts/{repositoryId}" ) + @Path ( "mergeConflictedArtifacts/{sourceRepositoryId}/{targetRepositoryId}" ) @GET @Produces ( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } ) @RedbackAuthorization ( noPermission = true ) @@ -45,6 +45,7 @@ public interface MergeRepositoriesService * <b>permissions are checked in impl</b> * @since 1.4-M3 */ - List<Artifact> getMergeConflictedArtifacts( @PathParam ( "repositoryId" ) String repositoryId ) + List<Artifact> getMergeConflictedArtifacts( @PathParam ( "sourceRepositoryId" ) String sourceRepositoryId, + @PathParam ( "targetRepositoryId" ) String targetRepositoryId ) throws ArchivaRestServiceException; } diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultMergeRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultMergeRepositoriesService.java index 3c20deb80..b88b4b120 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultMergeRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultMergeRepositoriesService.java @@ -45,18 +45,17 @@ public class DefaultMergeRepositoriesService private Maven2RepositoryMerger repositoryMerger; - public List<Artifact> getMergeConflictedArtifacts( String repositoryId ) + public List<Artifact> getMergeConflictedArtifacts( String sourceRepositoryId, String targetRepositoryId ) throws ArchivaRestServiceException { - String sourceRepoId = repositoryId + "-stage"; RepositorySession repositorySession = repositorySessionFactory.createSession(); try { List<ArtifactMetadata> artifactMetadatas = - repositoryMerger.getConflictingArtifacts( repositorySession.getRepository(), sourceRepoId, - repositoryId ); + repositoryMerger.getConflictingArtifacts( repositorySession.getRepository(), sourceRepositoryId, + targetRepositoryId ); - return buildArtifacts( artifactMetadatas, repositoryId ); + return buildArtifacts( artifactMetadatas, sourceRepositoryId ); } catch ( Exception e ) { diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/MergeRepositoriesServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/MergeRepositoriesServiceTest.java index ecba587cf..017ad1ae0 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/MergeRepositoriesServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/MergeRepositoriesServiceTest.java @@ -80,7 +80,7 @@ public class MergeRepositoriesServiceTest MergeRepositoriesService service = getMergeRepositoriesService(); - List<Artifact> artifactMetadatas = service.getMergeConflictedArtifacts( testRepoId ); + List<Artifact> artifactMetadatas = service.getMergeConflictedArtifacts( testRepoId + "-stage", testRepoId ); log.info( "conflicts: {}", artifactMetadatas ); |