mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-01 02:55:56 +01:00
merge
This commit is contained in:
@@ -4,6 +4,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.tmatesoft.svn.core.SVNException;
|
||||
import org.tmatesoft.svn.core.SVNLogEntry;
|
||||
import org.tmatesoft.svn.core.io.SVNRepository;
|
||||
import org.tmatesoft.svn.core.wc.SVNClientManager;
|
||||
import org.tmatesoft.svn.core.wc.admin.SVNLookClient;
|
||||
import sonia.scm.repository.InternalRepositoryException;
|
||||
import sonia.scm.repository.Modifications;
|
||||
import sonia.scm.repository.Repository;
|
||||
@@ -19,23 +21,45 @@ public class SvnModificationsCommand extends AbstractSvnCommand implements Modif
|
||||
super(context, repository);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Modifications getModifications(String revision) {
|
||||
Modifications modifications = null;
|
||||
log.debug("get modifications {}", revision);
|
||||
public Modifications getModifications(String revisionOrTransactionId) {
|
||||
Modifications modifications;
|
||||
try {
|
||||
long revisionNumber = SvnUtil.parseRevision(revision, repository);
|
||||
SVNRepository repo = open();
|
||||
Collection<SVNLogEntry> entries = repo.log(null, null, revisionNumber,
|
||||
revisionNumber, true, true);
|
||||
if (Util.isNotEmpty(entries)) {
|
||||
modifications = SvnUtil.createModifications(entries.iterator().next(), revision);
|
||||
if (SvnUtil.isTransactionEntryId(revisionOrTransactionId)) {
|
||||
modifications = getModificationsFromTransaction(SvnUtil.getTransactionId(revisionOrTransactionId));
|
||||
} else {
|
||||
modifications = getModificationFromRevision(revisionOrTransactionId);
|
||||
}
|
||||
return modifications;
|
||||
} catch (SVNException ex) {
|
||||
throw new InternalRepositoryException(repository, "could not open repository", ex);
|
||||
throw new InternalRepositoryException(
|
||||
repository,
|
||||
"failed to get svn modifications for " + revisionOrTransactionId,
|
||||
ex
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Modifications getModificationFromRevision(String revision) throws SVNException {
|
||||
log.debug("get svn modifications from revision: {}", revision);
|
||||
long revisionNumber = SvnUtil.getRevisionNumber(revision, repository);
|
||||
SVNRepository repo = open();
|
||||
Collection<SVNLogEntry> entries = repo.log(null, null, revisionNumber,
|
||||
revisionNumber, true, true);
|
||||
if (Util.isNotEmpty(entries)) {
|
||||
return SvnUtil.createModifications(entries.iterator().next(), revision);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Modifications getModificationsFromTransaction(String transaction) throws SVNException {
|
||||
log.debug("get svn modifications from transaction: {}", transaction);
|
||||
final Modifications modifications = new Modifications();
|
||||
SVNLookClient client = SVNClientManager.newInstance().getLookClient();
|
||||
client.doGetChanged(context.getDirectory(), transaction,
|
||||
e -> SvnUtil.appendModification(modifications, e.getType(), e.getPath()), true);
|
||||
|
||||
return modifications;
|
||||
}
|
||||
|
||||
@@ -44,5 +68,4 @@ public class SvnModificationsCommand extends AbstractSvnCommand implements Modif
|
||||
return getModifications(request.getRevision());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,42 @@
|
||||
{
|
||||
"scm-svn-plugin": {
|
||||
"information": {
|
||||
"checkout" : "Repository auschecken"
|
||||
"checkout": "Repository auschecken"
|
||||
},
|
||||
"config": {
|
||||
"link": "Subversion",
|
||||
"title": "Subversion Konfiguration",
|
||||
"compatibility": "Version Kompatibilität",
|
||||
"compatibilityHelpText": "Gibt an, mit welcher Subversion Version die Repositories kompatibel sind.",
|
||||
"compatibility-values": {
|
||||
"none": "Keine Kompatibilität",
|
||||
"pre14": "Vor 1.4 kompatibel",
|
||||
"pre15": "Vor 1.5 kompatibel",
|
||||
"pre16": "Vor 1.6 kompatibel",
|
||||
"pre17": "Vor 1.7 kompatibel",
|
||||
"with17": "Mit 1.7 kompatibel"
|
||||
},
|
||||
"enabledGZip": "GZip Compression aktivieren",
|
||||
"enabledGZipHelpText": "Aktiviert GZip Kompression für SVN Responses",
|
||||
"disabled": "Deaktiviert",
|
||||
"disabledHelpText": "Aktiviert oder deaktiviert das SVN Plugin",
|
||||
"required": "Dieser Konfigurationswert wird benötigt"
|
||||
}
|
||||
},
|
||||
"permissions": {
|
||||
"configuration": {
|
||||
"read": {
|
||||
"svn": {
|
||||
"displayName": "Subversion Konfiguration lesen",
|
||||
"description": "Darf die Subversion Konfiguration lesen"
|
||||
}
|
||||
},
|
||||
"write": {
|
||||
"svn": {
|
||||
"displayName": "Subversion Konfiguration schreiben",
|
||||
"description": "Darf die Subversion Konfiguration verändern"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"link": "Subversion",
|
||||
"title": "Subversion Configuration",
|
||||
"compatibility": "Version Compatibility",
|
||||
"compatibilityHelpText": "Specifies with which subversion version repositories are compatible.",
|
||||
"compatibilityHelpText": "Specifies with which Subversion version repositories are compatible.",
|
||||
"compatibility-values": {
|
||||
"none": "No compatibility",
|
||||
"pre14": "Pre 1.4 Compatible",
|
||||
@@ -17,9 +17,9 @@
|
||||
"with17": "With 1.7 Compatible"
|
||||
},
|
||||
"enabledGZip": "Enable GZip Compression",
|
||||
"enabledGZipHelpText": "Enable GZip compression for svn responses.",
|
||||
"enabledGZipHelpText": "Enable GZip compression for SVN responses.",
|
||||
"disabled": "Disabled",
|
||||
"disabledHelpText": "Enable or disable the Git plugin",
|
||||
"disabledHelpText": "Enable or disable the SVN plugin",
|
||||
"required": "This configuration value is required"
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user