mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
add tag endpoints
This commit is contained in:
@@ -36,13 +36,12 @@ package sonia.scm.repository.client.api;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sonia.scm.repository.client.spi.PushCommand;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
@@ -88,6 +87,14 @@ public final class PushCommandBuilder
|
||||
command.push();
|
||||
}
|
||||
|
||||
public void pushTags() throws IOException {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("push tag changes back to main repository");
|
||||
}
|
||||
|
||||
command.pushTags();
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
|
||||
@@ -36,15 +36,14 @@ package sonia.scm.repository.client.api;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sonia.scm.repository.Tag;
|
||||
import sonia.scm.repository.client.spi.TagCommand;
|
||||
import sonia.scm.repository.client.spi.TagRequest;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
@@ -84,9 +83,10 @@ public final class TagCommandBuilder
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
public Tag tag(String name) throws IOException
|
||||
public Tag tag(String name, String username) throws IOException
|
||||
{
|
||||
request.setName(name);
|
||||
request.setUsername(username);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
|
||||
@@ -44,11 +44,7 @@ import java.io.IOException;
|
||||
public interface PushCommand
|
||||
{
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
public void push() throws IOException;
|
||||
void push() throws IOException;
|
||||
|
||||
void pushTags() throws IOException;
|
||||
}
|
||||
|
||||
@@ -91,6 +91,7 @@ public final class TagRequest
|
||||
{
|
||||
this.name = null;
|
||||
this.revision = null;
|
||||
this.username = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,6 +107,7 @@ public final class TagRequest
|
||||
return MoreObjects.toStringHelper(this)
|
||||
.add("revision", revision)
|
||||
.add("name", name)
|
||||
.add("username", username)
|
||||
.toString();
|
||||
//J+
|
||||
}
|
||||
@@ -134,6 +136,10 @@ public final class TagRequest
|
||||
this.revision = revision;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
@@ -158,6 +164,10 @@ public final class TagRequest
|
||||
return revision;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return username;
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
@@ -165,4 +175,6 @@ public final class TagRequest
|
||||
|
||||
/** Field description */
|
||||
private String revision;
|
||||
|
||||
private String username;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user