added revision for mercurial sub repositories

This commit is contained in:
Sebastian Sdorra
2011-12-10 14:31:11 +01:00
parent 95c7f56c62
commit d7f0c9f33a
6 changed files with 232 additions and 18 deletions

View File

@@ -39,6 +39,9 @@ import sonia.scm.LastModifiedAware;
//~--- JDK imports ------------------------------------------------------------
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
/**
@@ -47,6 +50,7 @@ import javax.xml.bind.annotation.XmlRootElement;
* @since 1.5
*/
@XmlRootElement(name = "file")
@XmlAccessorType(XmlAccessType.FIELD)
public class FileObject implements LastModifiedAware
{
@@ -112,9 +116,9 @@ public class FileObject implements LastModifiedAware
* @since 1.10
* @return
*/
public String getSubRepositoryUrl()
public SubRepository getSubRepository()
{
return subRepositoryUrl;
return subRepository;
}
/**
@@ -200,12 +204,13 @@ public class FileObject implements LastModifiedAware
* Method description
*
*
* @param subRepositoryUrl
* @since 1.10
*
* @param subRepository
*/
public void setSubRepositoryUrl(String subRepositoryUrl)
public void setSubRepository(SubRepository subRepository)
{
this.subRepositoryUrl = subRepositoryUrl;
this.subRepository = subRepository;
}
//~--- fields ---------------------------------------------------------------
@@ -229,5 +234,6 @@ public class FileObject implements LastModifiedAware
private String path;
/** Field description */
private String subRepositoryUrl;
@XmlElement(name = "subrepository")
private SubRepository subRepository;
}

View File

@@ -0,0 +1,179 @@
/**
* Copyright (c) 2010, Sebastian Sdorra
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of SCM-Manager; nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* http://bitbucket.org/sdorra/scm-manager
*
*/
package sonia.scm.repository;
//~--- JDK imports ------------------------------------------------------------
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
/**
* @since 1.10
* @author Sebastian Sdorra
*/
@XmlRootElement(name = "subrepository")
@XmlAccessorType(XmlAccessType.FIELD)
public class SubRepository
{
/**
* Constructs ...
*
*/
public SubRepository() {}
/**
* Constructs ...
*
*
* @param repositoryUrl
*/
public SubRepository(String repositoryUrl)
{
this.repositoryUrl = repositoryUrl;
}
/**
* Constructs ...
*
*
* @param revision
* @param repositoryUrl
*/
public SubRepository(String repositoryUrl, String revision)
{
this.repositoryUrl = repositoryUrl;
this.revision = revision;
}
/**
* Constructs ...
*
*
* @param revision
* @param repositoryUrl
* @param browserUrl
*/
public SubRepository(String repositoryUrl, String browserUrl, String revision)
{
this.repositoryUrl = repositoryUrl;
this.browserUrl = browserUrl;
this.revision = revision;
}
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @return
*/
public String getBrowserUrl()
{
return browserUrl;
}
/**
* Method description
*
*
* @return
*/
public String getRepositoryUrl()
{
return repositoryUrl;
}
/**
* Method description
*
*
* @return
*/
public String getRevision()
{
return revision;
}
//~--- set methods ----------------------------------------------------------
/**
* Method description
*
*
* @param browserUrl
*/
public void setBrowserUrl(String browserUrl)
{
this.browserUrl = browserUrl;
}
/**
* Method description
*
*
* @param repositoryUrl
*/
public void setRepositoryUrl(String repositoryUrl)
{
this.repositoryUrl = repositoryUrl;
}
/**
* Method description
*
*
* @param revision
*/
public void setRevision(String revision)
{
this.revision = revision;
}
//~--- fields ---------------------------------------------------------------
/** Field description */
@XmlElement(name = "browser-url")
private String browserUrl;
/** Field description */
@XmlElement(name = "repository-url")
private String repositoryUrl;
/** Field description */
private String revision;
}