return changeset count for bundle and unbundle command

This commit is contained in:
Sebastian Sdorra
2014-11-02 17:55:59 +01:00
parent 1b7ab0a35d
commit 3e6ef0ce65
7 changed files with 165 additions and 8 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}
/**

View File

@@ -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));
}

View File

@@ -86,7 +86,8 @@ public class SvnUnbundleCommandTest extends AbstractSvnCommandTestBase
);
//J+
assertNotNull(res);
assertThat(res, notNullValue());
assertThat(res.getChangesetCount(), is(5l));
SVNRepository repo = ctx.open();