for(int count = 0; count < revisions.length; ++count){ locationRevs[count] = revisions[revisions.length-(count+1)];
for(int i = 0; i < revisions.length; ++i){ locationRevs[i] = revisions[revisions.length - (i + 1)];
    public int getLocations(String pathCame, long pegRevision, long[] revisions, ISVNLocationEntryHandler handler) throws SVNException {        assertValidRevision(pegRevision);        for (int i = 0; i < revisions.length; i++) {            assertValidRevision(revisions[i]);        }        try{    		openRepository();            pathCame = getRepositoryPath(pathCame);            ArrayList locationEntries = new ArrayList(0);                        long[] locationRevs = new long[revisions.length];            long revision;            FSRevisionNode root = null;            	            String parentPath = super.getRepositoryPath(pathCame);                        //check if parentPath is really absolute path relatively to repository            if(parentPath.charAt(0) != '/'){            	parentPath = "/".concat(parentPath);            }            //Sort revisions from greatest downward            Arrays.sort(revisions);            for(int count = 0; count < revisions.length; ++count){            	locationRevs[count] = revisions[revisions.length-(count+1)];            }                                   	//Ignore revisions R that are younger than the pegRevisions where            //path@pegRevision is not an ancestor of path@R.            int count = 0;            boolean resultAncestry = false;            for(count=0; count<locationRevs.length && locationRevs[count]>pegRevision; ++count){                                try{                    resultAncestry = FSNodeHistory.checkAncestryOfPegPath(myReposRootDir, parentPath, pegRevision, locationRevs[count], myRevNodesPool);                }catch(SVNException ex){                    /*TODO determine exception for FSFileNotFoundInSpecifiedRevisionException*/                    continue;                }            	if(true == resultAncestry){            		break;            	}            }            if(count >= locationRevs.length){            	return 0;            }            revision = resultAncestry ? locationRevs[count] : pegRevision;                                        String path = parentPath;            	            while(count < revisions.length){            	//Find the target of the innermost copy relevant to path@revision.           	    //The copy may be of path itself, or of a parent directory.            	           		root = FSReader.getRootRevNode(myReposRootDir, revision);           		FSClosestCopy tempClCopy = closestCopy(myReposRootDir, root, path);           		if(tempClCopy == null){           			break;           		}                FSRevisionNode croot = tempClCopy.getRevisionNode();           		if(croot == null){           			break;           		}           		String cpath = tempClCopy.getPath();           		//Assign the current path to all younger revisions until we reach           		//the copy target rev                long crev = croot.getId().isTxn() ? FSConstants.SVN_INVALID_REVNUM : croot.getId().getRevision();            	while((count < revisions.length) && (locationRevs[count] >= crev)){            		locationEntries.add(new SVNLocationEntry(locationRevs[count], path));            		++count;            	}            	// Follow the copy to its source.  Ignore all revs between the                // copy target rev and the copy source rev (non-inclusive).            	SVNLocationEntry sEntry = FSReader.copiedFrom(myReposRootDir, croot, cpath, myRevNodesPool);                /*!!here is inconsitance with code of svn: they write locationRevs[count] > sEntry.getRevision()*/           		while((count < revisions.length) && locationRevs[count] >= sEntry.getRevision() ){           			++count;           		}           	    /* Ultimately, it's not the path of the closest copy's source                   that we care about -- it's our own path's location in the                   copy source revision.  So we'll tack the relative path that                   expresses the difference between the copy destination and our                   path in the copy revision onto the copy source path to                   determine this information.                     In other words, if our path is "/branches/my-branch/foo/bar",                   and we know that the closest relevant copy was a copy of                   "/trunk" to "/branches/my-branch", then that relative path                   under the copy destination is "/foo/bar".  Tacking that onto                   the copy source path tells us that our path was located at                   "/trunk/foo/bar" before the copy.                */            	String reminder = path.equals(cpath) ? new String("") : new String(SVNPathUtil.pathIsChild(cpath, path));            	path = SVNPathUtil.concatToAbs(sEntry.getPath(), reminder);    		            	revision = sEntry.getRevision();            }           	/* There are no copies relevant to path@revision.  So any remaining               revisions either predate the creation of path@revision or have               the node existing at the same path.  We will look up path@lrev               for each remaining location-revision and make sure it is related               to path@revision. */    	       		root = FSReader.getRootRevNode(myReposRootDir, revision);       		FSRevisionNode curNode = FSReader.getRevisionNode(myReposRootDir, path, root, 0);       		while(count < revisions.length){            	SVNNodeKind kind = null;    		            	root = FSReader.getRootRevNode(myReposRootDir, locationRevs[count]);            	kind = this.checkNodeKind(path, FSRoot.createRevisionRoot(root.getId().getRevision(), root));            	if(kind == SVNNodeKind.NONE){            		break;            	}            	FSRevisionNode currentNode = FSReader.getRevisionNode(myReposRootDir, path, root, 0);            	            	if( FSID.checkIdsRelated(curNode.getId(), currentNode.getId()) == false ){            		break;            	}            	locationEntries.add(new SVNLocationEntry(locationRevs[count], path));            	++count;            }       		            for(count = 0; count < locationEntries.size(); count++)            {                /*sure we have handler*/                if(handler != null){                    handler.handleLocationEntry((SVNLocationEntry)locationEntries.get(count));                }            }            return count;    	}finally{    		closeRepository();    	}            }