Hi,
I have updated the above patch with the attachment
SVNBasedArtifactRepository.patch. When svn is update by a manager-node, svn
get a new revision number with the update but manager node remains in the
same revision number. It does not call checkout() or update() methods
above. If I restart the manger-node, there I can observe two different
values for newRevisionNumberLog and lastRevisionNumber inside checkout()
method of manager-node.
I have sent a pull request for the above fix.
Thanks,
Nipuni
On Mon, Jul 28, 2014 at 11:21 AM, Nipuni Perera <[email protected]> wrote:
> Hi,
>
> I have update the log messages and methods mentioned earlier. Find the
> attached patch.
>
> Thanks,
> Nipuni
>
>
> On Wed, Jul 9, 2014 at 3:35 PM, Nipuni Perera <[email protected]> wrote:
>
>>
>> Hi,
>>
>> I am working on $subject.Three methods below
>>
>> 1.
>>
>> checkout(int tenantId, String filePath, int depth)
>>
>> 2.
>>
>> update(int tenantId, String rootPath, String filePathToUpdate, int depth)
>>
>> 3.
>>
>> checkout(int tenantId, String filePath)
>>
>>
>> in [1] uses the code,
>>
>> filesUpdated = svnClient.update(root, SVNRevision.HEAD,Depth.infinity,
>> NO_SET_DEPTH,ignoreExternals, forceUpdate);
>>
>> svnClient.update(..) returns revision number but assigned to
>> filesUpdated. The method return value is set to
>>
>> filesUpdated >1
>>
>> which is incorrect. According to javadocs[2], methods should return true
>> if files were checked out or updates, false otherwise. If files were
>> changed, it can be detected comparing revision numbers. Therefore the
>> return value would be,
>>
>> long lastRevisionNumber =
>> svnClient.getInfo(root).getLastChangedRevision();
>> long newRevisionNumber = svnClient.update(root,
>> SVNRevision.HEAD,Depth.infinity, NO_SET_DEPTH,ignoreExternals, forceUpdate)
>> ;
>>
>> return newRevisionNumber>lastRevisionNumber;
>>
>> This gives different values for newRevisionNumberLog and
>> lastRevisionNumber, when I debug with a worker node, but gave same value
>> for both variables for manager node. What could be the issue here?. Log
>> messages
>> should also updated accordingly. Is there any other issue to consider?
>>
>> [1]
>> https://github.com/wso2-dev/carbon-commons/blob/master/components/deployment-synchronizer/org.wso2.carbon.deployment.synchronizer.subversion/src/main/java/org/wso2/carbon/deployment/synchronizer/subversion/SVNBasedArtifactRepository.java
>>
>> [2]
>> https://svn.wso2.org/repos/wso2/carbon/platform/trunk/components/deployment-synchronizer/org.wso2.carbon.deployment.synchronizer/src/main/java/org/wso2/carbon/deployment/synchronizer/ArtifactRepository.java
>>
>> Thanks,
>> Nipuni
>> --
>> Nipuni Perera
>> Software Engineer; WSO2 Inc.; http://wso2.com
>> Email: [email protected]
>> Git hub profile: https://github.com/nipuni
>> Mobile: +94 (71) 5626680
>>
>>
>
>
> --
> Nipuni Perera
> Software Engineer; WSO2 Inc.; http://wso2.com
> Email: [email protected]
> Git hub profile: https://github.com/nipuni
> Mobile: +94 (71) 5626680
> <http://wso2.com>
>
>
--
Nipuni Perera
Software Engineer; WSO2 Inc.; http://wso2.com
Email: [email protected]
Git hub profile: https://github.com/nipuni
Mobile: +94 (71) 5626680
<http://wso2.com>
diff --git a/components/deployment-synchronizer/org.wso2.carbon.deployment.synchronizer.subversion/pom.xml b/components/deployment-synchronizer/org.wso2.carbon.deployment.synchronizer.subversion/pom.xml
index 7a2cf80..2288291 100644
--- a/components/deployment-synchronizer/org.wso2.carbon.deployment.synchronizer.subversion/pom.xml
+++ b/components/deployment-synchronizer/org.wso2.carbon.deployment.synchronizer.subversion/pom.xml
@@ -73,6 +73,11 @@
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.utils</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.wso2.carbon</groupId>
+ <artifactId>org.wso2.carbon.tomcat</artifactId>
+ <version>4.3.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
</project>
diff --git a/components/deployment-synchronizer/org.wso2.carbon.deployment.synchronizer.subversion/src/main/java/org/wso2/carbon/deployment/synchronizer/subversion/SVNBasedArtifactRepository.java b/components/deployment-synchronizer/org.wso2.carbon.deployment.synchronizer.subversion/src/main/java/org/wso2/carbon/deployment/synchronizer/subversion/SVNBasedArtifactRepository.java
index f4e7547..f73dfea 100644
--- a/components/deployment-synchronizer/org.wso2.carbon.deployment.synchronizer.subversion/src/main/java/org/wso2/carbon/deployment/synchronizer/subversion/SVNBasedArtifactRepository.java
+++ b/components/deployment-synchronizer/org.wso2.carbon.deployment.synchronizer.subversion/src/main/java/org/wso2/carbon/deployment/synchronizer/subversion/SVNBasedArtifactRepository.java
@@ -432,14 +432,14 @@ public class SVNBasedArtifactRepository implements ArtifactRepository {
tries++;
if (svnClient instanceof CmdLineClientAdapter) {
// CmdLineClientAdapter does not support all the options
- lastRevisionNumber = svnClient.getInfo(root).getLastChangedRevision().getNumber();
+ lastRevisionNumber = svnClient.getSingleStatus(root).getLastChangedRevision().getNumber();
newRevisionNumber = svnClient.update(root, SVNRevision.HEAD, RECURSIVE);
if (log.isDebugEnabled()) {
log.debug(" files were updated to revision number: "+newRevisionNumber+" using CmdLineClientAdapter");
}
} else {
- lastRevisionNumber = svnClient.getInfo(root).getLastChangedRevision().getNumber();
- lastRevisionNumber = svnClient.update(root, SVNRevision.HEAD,
+ lastRevisionNumber = svnClient.getSingleStatus(root).getLastChangedRevision().getNumber();
+ newRevisionNumber = svnClient.update(root, SVNRevision.HEAD,
Depth.infinity, NO_SET_DEPTH,
ignoreExternals, forceUpdate);
if (log.isDebugEnabled()) {
@@ -610,11 +610,11 @@ public class SVNBasedArtifactRepository implements ArtifactRepository {
tries++;
if (svnClient instanceof CmdLineClientAdapter) {
// CmdLineClientAdapter does not support all the options
- lastRevisionNumber = svnClient.getInfo(root).getLastChangedRevision().getNumber();
+ lastRevisionNumber = svnClient.getSingleStatus(root).getLastChangedRevision().getNumber();
newRevisionNumber = svnClient.update(root, SVNRevision.HEAD, RECURSIVE);
log.info("files were updated to revision number: " +newRevisionNumber+ " using CmdLineClientAdapter");
} else {
- lastRevisionNumber = svnClient.getInfo(root).getLastChangedRevision().getNumber();
+ lastRevisionNumber = svnClient.getSingleStatus(root).getLastChangedRevision().getNumber();
newRevisionNumber = svnClient.update(root, SVNRevision.HEAD,
depth, NO_SET_DEPTH,
ignoreExternals, forceUpdate);
@@ -681,11 +681,11 @@ public class SVNBasedArtifactRepository implements ArtifactRepository {
tries++;
if (svnClient instanceof CmdLineClientAdapter) {
// CmdLineClientAdapter does not support all the options
- lastRevisionNumber = svnClient.getInfo(root).getLastChangedRevision().getNumber();
+ lastRevisionNumber = svnClient.getSingleStatus(root).getLastChangedRevision().getNumber();
newRevisionNumber = svnClient.update(root, SVNRevision.HEAD, RECURSIVE);
log.info("files were updated to revision number: "+newRevisionNumber + " using CmdLineClientAdapter");
} else {
- lastRevisionNumber = svnClient.getInfo(root).getLastChangedRevision().getNumber();
+ lastRevisionNumber = svnClient.getSingleStatus(root).getLastChangedRevision().getNumber();
newRevisionNumber = svnClient.update(root, filePath,SVNRevision.HEAD,
depth, setDepth,
ignoreExternals, forceUpdate);
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev