Package org.tmatesoft.svn.core.internal.wc.admin

Examples of org.tmatesoft.svn.core.internal.wc.admin.ISVNEntryHandler


                if (admLockLevel >= 0) {
                    admLockLevel++;
                }
                wcAccess.probeOpen(path.getParentFile(), true, admLockLevel);
            }
            ISVNEntryHandler resolveEntryHandler = new ISVNEntryHandler() {
                public void handleEntry(File path, SVNEntry entry) throws SVNException {
                    if (entry != null && entry.isDirectory() && !"".equals(entry.getName())) {
                        return;
                    }
                    SVNNodeKind kind = SVNNodeKind.UNKNOWN;
                    long revision = -1;
                    boolean wcRoot = false;
                    boolean resolved = false;
                    if (entry != null && entry.isDirectory()) {
                        wcRoot = wcAccess.isWCRoot(path);
                    }
                    if (resolveTree && !wcRoot) {                       
                        File parentDir = path.getParentFile();
                        SVNAdminArea parentArea = wcAccess.probeRetrieve(parentDir);
                        SVNTreeConflictDescription tc = parentArea.getTreeConflict(path.getName());
                        if (tc != null) {
                            parentArea.deleteTreeConflict(path.getName());
                            kind = tc.getNodeKind();
                            resolved = true;
                        }
                    }
                    if (entry != null && (resolveContents || resolveProperties)) {
                        kind = entry.getKind();
                        revision = entry.getRevision();
                        File conflictDir = entry.isDirectory() ? path : path.getParentFile();
                        SVNAdminArea conflictArea = wcAccess.retrieve(conflictDir);
                        resolved |= conflictArea.markResolved(entry.getName(), resolveContents, resolveProperties, choice);
                    }
                    if (resolved) {
                        SVNEvent event = SVNEventFactory.createSVNEvent(path, kind, null,
                                revision, SVNEventAction.RESOLVED, null, null, null);
                        dispatchEvent(event);
                    }
                }

                public void handleError(File path, SVNErrorMessage error) throws SVNException {
                    SVNErrorManager.error(error, SVNLogType.WC);
                }
            };

            if (depth == SVNDepth.EMPTY) {
                SVNEntry entry = wcAccess.getEntry(path, false);
                if (entry != null) {
                    resolveEntryHandler.handleEntry(path, entry);
                } else {
                    SVNTreeConflictDescription tc = wcAccess.getTreeConflict(path);
                    if (tc != null) {
                        resolveEntryHandler.handleEntry(path, null);
                    } else {
                        SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND,
                                "''{0}'' is not under version control", path);
                        SVNErrorManager.error(err, SVNLogType.WC);
                    }
View Full Code Here


            final ISVNInfoHandler handler) throws SVNException {
        final SVNWCAccess wcAccess = createWCAccess();
        int admLockLevel = getLevelsToLockFromDepth(depth);
        try {
            wcAccess.probeOpen(path, false, admLockLevel);
            wcAccess.walkEntries(path, new ISVNEntryHandler() {
                public void handleEntry(File path, SVNEntry entry) throws SVNException {
                    if (entry.isDirectory() && !entry.isThisDir()) {
                        return;
                    }                   
                    if (SVNWCAccess.matchesChangeList(changeLists, entry)) {
View Full Code Here

            depth = SVNDepth.EMPTY;
        }
       
        File target = area.getFile(entry.getName());
        SVNWCAccess wcAccess = area.getWCAccess();
        ISVNEntryHandler propGetHandler = new PropFetchHandler(changeLists, propName, handler, base);
        if (SVNDepth.FILES.compareTo(depth) <= 0 && entry.isDirectory()) {
            wcAccess.walkEntries(target, propGetHandler, false, depth);
        } else if (SVNWCAccess.matchesChangeList(changeLists, entry)) {
            if (propName == null) {//proplist hack for compatibility with subvsersion
                SVNVersionedProperties properties = base ? area.getBaseProperties(entry.getName()) : area.getProperties(entry.getName());
                if (propName != null) {
                    SVNPropertyValue propValue = properties.getPropertyValue(propName);
                    if (propValue != null) {
                        handler.handleProperty(target, new SVNPropertyData(propName, propValue, getOptions()));
                    }
                } else {
                    SVNProperties allProps = properties.asMap();
                    for (Iterator names = allProps.nameSet().iterator(); names.hasNext();) {
                        String name = (String) names.next();
                        SVNPropertyValue val = allProps.getSVNPropertyValue(name);
                        handler.handleProperty(area.getFile(entry.getName()), new SVNPropertyData(name, val, getOptions()));
                    }
                }
            } else {
                propGetHandler.handleEntry(target, entry);
            }
        }
    }
View Full Code Here

   
    private List getMergeInfoPaths(final List children, final String mergeSrcPath,
        SVNEntry entry, final SVNURL sourceRootURL, final long revision1,
        final long revision2, boolean honorMergeInfo, final SVNRepository repository, final SVNDepth depth) throws SVNException {
      final List childrenWithMergeInfo = children == null ? new LinkedList() : children;
        ISVNEntryHandler handler = getMergeInfoEntryHandler(mergeSrcPath, sourceRootURL, revision1, revision2, repository, depth,
                childrenWithMergeInfo);

        if (entry.isFile()) {
            handler.handleEntry(myTarget, entry);
        } else {
            myWCAccess.walkEntries(myTarget, handler, true, honorMergeInfo ? depth : SVNDepth.EMPTY);
        }
       
        if (honorMergeInfo && SVNDepth.EMPTY.compareTo(depth) < 0) {
View Full Code Here

    public boolean treeHasLocalModifications(SVNAdminArea adminArea, final boolean[] allModsAreDeletes) throws SVNException {
        final boolean[] modified = new boolean[]{false};
        if (allModsAreDeletes != null) {
            allModsAreDeletes[0] = true;
        }
        final ISVNEntryHandler entryHandler = new ISVNEntryHandler() {
            public void handleEntry(File path, SVNEntry entry) throws SVNException {
                boolean hasModifications;
                SVNAdminArea entryArea;
                try {
                    entryArea = myWCAccess.probeRetrieve(path);
View Full Code Here

            }
        }
        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())) {
View Full Code Here

    public static Map getWorkingCopyPropertyValues(File path, SVNEntry entry, final String propName,
                                                   SVNDepth depth, final boolean base) throws SVNException {
        final Map pathsToPropValues = new SVNHashMap();

        ISVNEntryHandler handler = new ISVNEntryHandler() {
            public void handleEntry(File itemPath, SVNEntry itemEntry) throws SVNException {
                SVNAdminArea adminArea = itemEntry.getAdminArea();
                if (itemEntry.isDirectory() && !itemEntry.getName().equals(adminArea.getThisDirName())) {
                    return;
                }

                if ((itemEntry.isScheduledForAddition() && base) ||
                        (itemEntry.isScheduledForDeletion() && !base)) {
                    return;
                }

                SVNPropertyValue propValue = null;
                SVNWCAccess access = adminArea.getWCAccess();
                if (base) {
                    SVNEntry pathEntry = access.getEntry(itemPath, false);
                    if (pathEntry != null) {
                        SVNAdminArea pathArea = pathEntry.getAdminArea();
                        SVNVersionedProperties baseProps = pathArea.getBaseProperties(pathEntry.getName());
                        propValue = baseProps.getPropertyValue(propName);
                    }
                } else {
                    SVNEntry pathEntry = access.getEntry(itemPath, true);
                    if (pathEntry != null) {
                        SVNAdminArea pathArea = pathEntry.getAdminArea();
                        SVNVersionedProperties workingProps = pathArea.getProperties(pathEntry.getName());
                        propValue = workingProps.getPropertyValue(propName);
                    }
                }

                if (propValue != null) {
                    pathsToPropValues.put(itemPath, propValue);
                }
            }

            public void handleError(File path, SVNErrorMessage error) throws SVNException {
                while (error.hasChildErrorMessage()) {
                    error = error.getChildErrorMessage();
                }
                if (error.getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND) {
                    return;
                }
                SVNErrorManager.error(error, SVNLogType.WC);
            }
        };

        if (depth == SVNDepth.UNKNOWN) {
            depth = SVNDepth.INFINITY;
        }

        SVNAdminArea adminArea = entry.getAdminArea();
        if (entry.isDirectory() && depth.compareTo(SVNDepth.FILES) >= 0) {
            SVNWCAccess wcAccess = adminArea.getWCAccess();
            wcAccess.walkEntries(path, handler, false, depth);
        } else {
            handler.handleEntry(path, entry);
        }

        return pathsToPropValues;
    }
View Full Code Here

        path = path.getAbsoluteFile();
        SVNWCAccess wcAccess = createWCAccess();
        try {
            wcAccess.probeOpen(path, false, SVNWCAccess.INFINITE_DEPTH);
           
            ISVNEntryHandler entryHandler = new ISVNEntryHandler() {
               
                public void handleEntry(File path, SVNEntry entry) throws SVNException {
                    if (SVNWCAccess.matchesChangeList(changeLists, entry) &&
                            (entry.isFile() || (entry.isDirectory() &&
                                    entry.getName().equals(entry.getAdminArea().getThisDirName())))) {
View Full Code Here

        path = path.getAbsoluteFile();
        SVNWCAccess wcAccess = createWCAccess();
        try {
            wcAccess.probeOpen(path, false, SVNWCAccess.INFINITE_DEPTH);
           
            ISVNEntryHandler entryHandler = new ISVNEntryHandler() {
               
                public void handleEntry(File path, SVNEntry entry) throws SVNException {
                    if (SVNWCAccess.matchesChangeList(changeLists, entry) &&
                            (entry.isFile() || (entry.isDirectory() &&
                                    entry.getName().equals(entry.getAdminArea().getThisDirName())))) {
View Full Code Here

            admLockLevel = 0;
        }

        try {
            wcAccess.probeOpen(path, true, admLockLevel);
            ISVNEntryHandler resolveEntryHandler = new ISVNEntryHandler() {
                public void handleEntry(File path, SVNEntry entry) throws SVNException {
                    SVNAdminArea adminArea = entry.getAdminArea();
                    if (entry.isDirectory() && !adminArea.getThisDirName().equals(entry.getName())) {
                        return;
                    }

                    File conflictDir = entry.isDirectory() ? path : path.getParentFile();
                    SVNAdminArea conflictArea = wcAccess.retrieve(conflictDir);
                    if (conflictArea.markResolved(entry.getName(), true, true, choice)) {
                        SVNEvent event = SVNEventFactory.createSVNEvent(conflictArea.getFile(entry.getName()), entry.getKind(), null, entry.getRevision(), SVNEventAction.RESOLVED, null, null, null);
                        dispatchEvent(event);
                    }
                }

                public void handleError(File path, SVNErrorMessage error) throws SVNException {
                    SVNErrorManager.error(error, SVNLogType.WC);
                }
            };

            if (depth == SVNDepth.EMPTY) {
                SVNEntry entry = wcAccess.getVersionedEntry(path, false);
                resolveEntryHandler.handleEntry(path, entry);
            } else {
                wcAccess.walkEntries(path, resolveEntryHandler, false, depth);
            }
        } finally {
            wcAccess.close();
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.internal.wc.admin.ISVNEntryHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.