private void doCanonicalizeURLs(SVNAdminAreaInfo adminAreaInfo, SVNAdminArea adminArea, String name, boolean omitDefaultPort, boolean recursive) throws SVNException {
boolean save = false;
checkCancelled();
if (!adminArea.getThisDirName().equals(name)) {
SVNEntry entry = adminArea.getEntry(name, true);
save = canonicalizeEntry(entry, omitDefaultPort);
adminArea.getWCProperties(name).setPropertyValue(SVNProperty.WC_URL, null);
if (save) {
adminArea.saveEntries(false);
}
return;
}
if (!isIgnoreExternals()) {
SVNPropertyValue externalsValue = adminArea.getProperties(adminArea.getThisDirName()).getPropertyValue(SVNProperty.EXTERNALS);
if (externalsValue != null) {
String ownerPath = adminArea.getRelativePath(adminAreaInfo.getAnchor());
String externals = externalsValue == null ? null : externalsValue.getString();
adminAreaInfo.addExternal(ownerPath, externals, externals);
if (externalsValue != null) {
externalsValue = SVNPropertyValue.create(canonicalizeExtenrals(externals, omitDefaultPort));
adminArea.getProperties(adminArea.getThisDirName()).setPropertyValue(SVNProperty.EXTERNALS, externalsValue);
}
}
}
SVNEntry rootEntry = adminArea.getEntry(adminArea.getThisDirName(), true);
save = canonicalizeEntry(rootEntry, omitDefaultPort);
adminArea.getWCProperties(adminArea.getThisDirName()).setPropertyValue(SVNProperty.WC_URL, null);
// now all child entries that doesn't has repos/url has new values.
for(Iterator ents = adminArea.entries(true); ents.hasNext();) {
SVNEntry entry = (SVNEntry) ents.next();
if (adminArea.getThisDirName().equals(entry.getName())) {
continue;
}
checkCancelled();
if (recursive && entry.isDirectory() &&
(entry.isScheduledForAddition() || !entry.isDeleted()) &&
!entry.isAbsent()) {
SVNAdminArea childArea = adminArea.getWCAccess().retrieve(adminArea.getFile(entry.getName()));
if (childArea != null) {
doCanonicalizeURLs(adminAreaInfo, childArea, "", omitDefaultPort, recursive);
}
}
save |= canonicalizeEntry(entry, omitDefaultPort);
SVNVersionedProperties properties = adminArea.getWCProperties(entry.getName());
if (properties != null) {
properties.setPropertyValue(SVNProperty.WC_URL, null);
}
}
if (save) {