mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
add tag endpoints
This commit is contained in:
@@ -32,9 +32,10 @@ package sonia.scm.repository.client.spi;
|
||||
|
||||
import com.aragost.javahg.Repository;
|
||||
import com.aragost.javahg.commands.ExecutionException;
|
||||
import java.io.IOException;
|
||||
import sonia.scm.repository.client.api.RepositoryClientException;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Mercurial implementation of the {@link PushCommand}.
|
||||
*
|
||||
@@ -63,5 +64,10 @@ public class HgPushCommand implements PushCommand
|
||||
throw new RepositoryClientException("push to repository failed", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void pushTags() throws IOException {
|
||||
push();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ package sonia.scm.repository.client.spi;
|
||||
|
||||
import com.aragost.javahg.Repository;
|
||||
import com.google.common.base.Strings;
|
||||
import java.io.IOException;
|
||||
import sonia.scm.repository.Tag;
|
||||
|
||||
/**
|
||||
@@ -51,13 +50,16 @@ public class HgTagCommand implements TagCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tag tag(TagRequest request) throws IOException
|
||||
public Tag tag(TagRequest request)
|
||||
{
|
||||
String rev = request.getRevision();
|
||||
if ( Strings.isNullOrEmpty(rev) ){
|
||||
rev = repository.tip().getNode();
|
||||
}
|
||||
com.aragost.javahg.commands.TagCommand.on(repository).rev(rev).execute(request.getName());
|
||||
com.aragost.javahg.commands.TagCommand.on(repository)
|
||||
.rev(rev)
|
||||
.user(request.getUserName())
|
||||
.execute(request.getName());
|
||||
return new Tag(request.getName(), rev);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user