}
private void scheduleExistingEntryForReAdd(final SVNEntry entry, final File path, SVNURL theirURL) throws SVNException {
final File parentPath = path.getParentFile();
String entryName = path.getName();
Map attributes = new SVNHashMap();
attributes.put(SVNProperty.URL, theirURL.toString());
attributes.put(SVNProperty.SCHEDULE, SVNProperty.SCHEDULE_ADD);
attributes.put(SVNProperty.COPYFROM_URL, entry.getURL());
attributes.put(SVNProperty.COPYFROM_REVISION, String.valueOf(entry.getRevision()));
attributes.put(SVNProperty.COPIED, Boolean.TRUE.toString());
if (myIsLockOnDemand && entry.isDirectory()) {
SVNAdminArea area = myWCAccess.getAdminArea(path);
if (area != null && !area.isLocked()) {
area.lock(false);
}
}
final SVNAdminArea adminArea = myWCAccess.retrieve(entry.isDirectory() ? path : parentPath);
adminArea.modifyEntry(entry.isDirectory() ? adminArea.getThisDirName() : entryName, attributes, true, true);
if (entry.isDirectory()) {
ISVNEntryHandler entryHandler = new ISVNEntryHandler() {
public void handleEntry(File ePath, SVNEntry e) throws SVNException {
if (!path.equals(ePath)) {
SVNAdminArea eArea;
if (myIsLockOnDemand && e.isDirectory() && !adminArea.getThisDirName().equals(e.getName())) {
SVNAdminArea childArea = myWCAccess.getAdminArea(ePath);
if (childArea != null && !childArea.isLocked()) {
childArea.lock(false);
}
}
if (adminArea.getThisDirName().equals(e.getName())) {
eArea = myWCAccess.retrieve(ePath);
} else {
eArea = myWCAccess.retrieve(ePath.getParentFile());
}
if (e.getSchedule() == null) {
Map eAttrs = new SVNHashMap();
eAttrs.put(SVNProperty.COPIED, Boolean.TRUE.toString());
eArea.modifyEntry(e.getName(), eAttrs, true, false);
}
}
}