mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 00:45:44 +01:00
implement gzip compression for unbundle command
This commit is contained in:
@@ -81,6 +81,17 @@ public class ImportBundleSubCommand extends ImportSubCommand
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isCompressed()
|
||||
{
|
||||
return compressed;
|
||||
}
|
||||
|
||||
//~--- set methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
@@ -94,6 +105,17 @@ public class ImportBundleSubCommand extends ImportSubCommand
|
||||
this.bundle = bundle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param compressed
|
||||
*/
|
||||
public void setCompressed(boolean compressed)
|
||||
{
|
||||
this.compressed = compressed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -122,9 +144,13 @@ public class ImportBundleSubCommand extends ImportSubCommand
|
||||
{
|
||||
ScmClientSession session = createSession();
|
||||
|
||||
Repository repository = session.getRepositoryHandler().importFromBundle(
|
||||
new ImportBundleRequest(
|
||||
getType(), name, Files.asByteSource(bundle)));
|
||||
ImportBundleRequest req = new ImportBundleRequest(getType(), name,
|
||||
Files.asByteSource(bundle));
|
||||
|
||||
req.setCompressed(compressed);
|
||||
|
||||
Repository repository =
|
||||
session.getRepositoryHandler().importFromBundle(req);
|
||||
|
||||
printImportedRepository(repository);
|
||||
}
|
||||
@@ -141,6 +167,14 @@ public class ImportBundleSubCommand extends ImportSubCommand
|
||||
)
|
||||
private File bundle;
|
||||
|
||||
/** Field description */
|
||||
@Option(
|
||||
name = "--compressed",
|
||||
usage = "optionRepositoryBundleCompressed",
|
||||
aliases = { "-c" }
|
||||
)
|
||||
private boolean compressed = false;
|
||||
|
||||
/** Field description */
|
||||
@Option(
|
||||
name = "--name",
|
||||
|
||||
@@ -53,6 +53,7 @@ optionRepositoryPublic = Repository public readable
|
||||
optionRepositoryArchive = Repository archived
|
||||
optionRemoteRepositoryUrl = Remote repository url
|
||||
optionRepositoryBundle = Import repository from a bundle file (e.g. svn dump)
|
||||
optionRepositoryBundleCompressed = Indicates that the bundle is gzip compressed
|
||||
|
||||
optionPermissionGroup = Group
|
||||
optionPermissionName = Group or user name
|
||||
|
||||
Reference in New Issue
Block a user