mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-10-31 18:46:07 +01:00
return changeset count for bundle and unbundle command
This commit is contained in:
@@ -125,6 +125,8 @@ public class SvnBundleCommand extends AbstractSvnCommand
|
||||
ByteSink archive = checkNotNull(request.getArchive(),
|
||||
"archive is required");
|
||||
|
||||
BundleResponse response;
|
||||
|
||||
SVNClientManager clientManager = null;
|
||||
|
||||
try
|
||||
@@ -134,6 +136,7 @@ public class SvnBundleCommand extends AbstractSvnCommand
|
||||
SVNAdminClient adminClient = clientManager.getAdminClient();
|
||||
|
||||
dump(adminClient, context.getDirectory(), archive);
|
||||
response = new BundleResponse(context.open().getLatestRevision());
|
||||
}
|
||||
catch (SVNException ex)
|
||||
{
|
||||
@@ -144,6 +147,6 @@ public class SvnBundleCommand extends AbstractSvnCommand
|
||||
SvnUtil.dispose(clientManager);
|
||||
}
|
||||
|
||||
return new BundleResponse();
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,6 +105,8 @@ public class SvnUnbundleCommand extends AbstractSvnCommand
|
||||
logger.debug("archive repository {} to {}", context.getDirectory(),
|
||||
archive);
|
||||
|
||||
UnbundleResponse response;
|
||||
|
||||
SVNClientManager clientManager = null;
|
||||
|
||||
try
|
||||
@@ -114,6 +116,8 @@ public class SvnUnbundleCommand extends AbstractSvnCommand
|
||||
SVNAdminClient adminClient = clientManager.getAdminClient();
|
||||
|
||||
restore(adminClient, archive, context.getDirectory());
|
||||
|
||||
response = new UnbundleResponse(context.open().getLatestRevision());
|
||||
}
|
||||
catch (SVNException ex)
|
||||
{
|
||||
@@ -124,7 +128,7 @@ public class SvnUnbundleCommand extends AbstractSvnCommand
|
||||
SvnUtil.dispose(clientManager);
|
||||
}
|
||||
|
||||
return new UnbundleResponse();
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -77,7 +77,8 @@ public class SvnBundleCommandTest extends AbstractSvnCommandTestBase
|
||||
BundleResponse res = new SvnBundleCommand(createContext(),
|
||||
repository).bundle(req);
|
||||
|
||||
assertNotNull(res);
|
||||
assertThat(res, notNullValue());
|
||||
assertThat(res.getChangesetCount(), is(5l));
|
||||
assertTrue("file does not exists", file.exists());
|
||||
assertThat(file.length(), greaterThan(0l));
|
||||
}
|
||||
|
||||
@@ -86,7 +86,8 @@ public class SvnUnbundleCommandTest extends AbstractSvnCommandTestBase
|
||||
);
|
||||
//J+
|
||||
|
||||
assertNotNull(res);
|
||||
assertThat(res, notNullValue());
|
||||
assertThat(res.getChangesetCount(), is(5l));
|
||||
|
||||
SVNRepository repo = ctx.open();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user