if (current != null && current.getUnresolvedUrl().equals(item.getUnresolvedUrl()) && current.getPath().equals(item.getPath())) {
itemToPin = current;
break;
SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "Cannot pin external ''{0}'' defined in {1} at ''{2}'' because it is not checked out in the working copy at ''{3}''", item.getUnresolvedUrl(), SVNProperty.EXTERNALS, localAbsPathOrUrl.getFile(), externalAbsPath.getAbsolutePath(), SVNProperty.EXTERNALS);
SVNErrorManager.error(errorMessage, SVNLogType.CLIENT);
} else if (externalKind == ISVNWCDb.SVNWCDbKind.Dir) {
SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "Cannot pin external ''{0}'' defined in {1} at ''{2}'' because ''{3}'' has switched subtrees (switches cannot be represented in {4})", item.getUnresolvedUrl(), SVNProperty.EXTERNALS, localAbsPathOrUrl.getFile(), externalAbsPath.getAbsolutePath(), SVNProperty.EXTERNALS);
SVNErrorManager.error(errorMessage, SVNLogType.CLIENT);
SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "Cannot pin external ''{0}'' defined in {1} at ''{2}'' because ''{3}'' has local modifications (local modifications cannot be represented in {4})", item.getUnresolvedUrl(), SVNProperty.EXTERNALS, localAbsPathOrUrl.getFile(), externalAbsPath.getAbsolutePath(), SVNProperty.EXTERNALS);
SVNErrorManager.error(errorMessage, SVNLogType.CLIENT);
SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "Cannot pin external ''{0}'' defined in {1} at ''{2}'' because ''{3}'' is a mixed-revision working copy (mixed-revisions cannot be represented in {4})", item.getUnresolvedUrl(), SVNProperty.EXTERNALS, localAbsPathOrUrl.getFile(), externalAbsPath.getAbsolutePath(), SVNProperty.EXTERNALS);
SVNErrorManager.error(errorMessage, SVNLogType.CLIENT);