/** * Returns an instance of the {@link SVNAdminClient} class. * * <p> * If it's the first time this method is being called the object is * created, initialized and then returned. Further calls to this * method will get the same object instantiated at that moment of * the first call. <b>SVNClientManager</b> does not reinstantiate * its <b>SVN</b>*<b>Client</b> objects. * * @return an <b>SVNAdminClient</b> instance */ public SVNAdminClient getAdminClient() { if (myAdminClient == null) { myAdminClient = new SVNAdminClient(this, myOptions); myAdminClient.setEventHandler(myEventHandler); myAdminClient.setDebugLog(getDebugLog()); } return myAdminClient; }
SVNRepository toRepos = createRepository(toURL, true); checkIfRepositoryIsAtRoot(toRepos, toURL); lock(toRepos); try { SessionInfo info = openSourceRepository(toRepos); if (revision > info.myLastMergedRevision) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Cannot copy revprops for a revision that has not been synchronized yet"); SVNErrorManager.error(err); copyRevisionProperties(info.myRepository, toRepos, revision, false); } catch (SVNException svne) { error = svne; } finally { try { unlock(toRepos); } catch (SVNException svne) { error2 = svne;
doInitialize(fromURL, toURL); doSynchronize(toURL); return; } catch (SVNException svne) { SVNRepository fromRepos = createRepository(fromURL, true); SVNRepository toRepos = createRepository(toURL, false); replicator.replicateRepository(fromRepos, toRepos, 1, -1);
private SessionInfo openSourceRepository(SVNRepository targetRepos) throws SVNException { String fromURL = targetRepos.getRevisionPropertyValue(0, SVNRevisionProperty.FROM_URL); String fromUUID = targetRepos.getRevisionPropertyValue(0, SVNRevisionProperty.FROM_UUID); String lastMergedRev = targetRepos.getRevisionPropertyValue(0, SVNRevisionProperty.LAST_MERGED_REVISION); if (fromURL == null || fromUUID == null || lastMergedRev == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Destination repository has not been initialized"); SVNErrorManager.error(err); } SVNURL srcURL = SVNURL.parseURIDecoded(fromURL); SVNRepository srcRepos = createRepository(srcURL, false); checkIfRepositoryIsAtRoot(srcRepos, srcURL); String reposUUID = srcRepos.getRepositoryUUID(true); if (!fromUUID.equals(reposUUID)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "UUID of destination repository ({0}) does not match expected UUID ({1})", new String[] { reposUUID, fromUUID }); SVNErrorManager.error(err); } return new SessionInfo(srcRepos, Long.parseLong(lastMergedRev)); }
myAdminClient.setDebugLog(log);
SVNRepository toRepos = createRepository(toURL, true); checkIfRepositoryIsAtRoot(toRepos, toURL); lock(toRepos); try { long latestRevision = toRepos.getLatestRevision(); SVNRepository fromRepos = createRepository(fromURL, false); checkIfRepositoryIsAtRoot(fromRepos, fromURL); toRepos.setRevisionPropertyValue(0, SVNRevisionProperty.LAST_MERGED_REVISION, "0"); copyRevisionProperties(fromRepos, toRepos, 0, false); } catch (SVNException svne) { error = svne; } finally { try { unlock(toRepos); } catch (SVNException svne) { error2 = svne;
SVNRepository toRepos = createRepository(toURL, true); checkIfRepositoryIsAtRoot(toRepos, toURL); lock(toRepos); try { SessionInfo info = openSourceRepository(toRepos); SVNRepository fromRepos = info.myRepository; long lastMergedRevision = info.myLastMergedRevision; } else if (copyingRev == toLatestRevision) { if (copyingRev > lastMergedRevision) { copyRevisionProperties(fromRepos, toRepos, toLatestRevision, true); lastMergedRevision = copyingRev; toRepos.setRevisionPropertyValue(0, SVNRevisionProperty.CURRENTLY_COPYING, SVNProperty.toString(currentRev)); SVNSynchronizeEditor syncEditor = new SVNSynchronizeEditor(toRepos, mySyncHandler, currentRev - 1); ISVNEditor cancellableEditor = SVNCancellableEditor.newInstance(syncEditor, this, getDebugLog()); fromRepos.replay(0, currentRev, true, cancellableEditor); cancellableEditor.closeEdit(); copyRevisionProperties(fromRepos, toRepos, currentRev, true); toRepos.setRevisionPropertyValue(0, SVNRevisionProperty.LAST_MERGED_REVISION, SVNProperty.toString(currentRev)); toRepos.setRevisionPropertyValue(0, SVNRevisionProperty.CURRENTLY_COPYING, null); } finally { try { unlock(toRepos); } catch (SVNException svne) { error2 = svne;