*  answer ... well, you get the picture.*/
*  answer. */
    public long log(String[] targetPaths, long startRevision, long endRevision, boolean discoverChangedPath, boolean strictNode, long limit, ISVNLogEntryHandler handler) throws SVNException {    	try{    		openRepository();            long youngestRev = FSReader.getYoungestRevision(myReposRootDir);            if(FSRepository.isInvalidRevision(startRevision)){                startRevision = youngestRev;            }            if(startRevision > youngestRev){                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_REVISION, "No such revision {0,number,integer}", new Long(startRevision));                SVNErrorManager.error(err);            }            if(FSRepository.isInvalidRevision(endRevision)){                endRevision = youngestRev;            }            if(endRevision > youngestRev){                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_REVISION, "No such revision {0,number,integer}", new Long(endRevision));                SVNErrorManager.error(err);            }            long histStart = FSConstants.SVN_INVALID_REVNUM;            long histEnd = FSConstants.SVN_INVALID_REVNUM;                    	//Get an ordered copy of the start and end        	if(startRevision > endRevision){        		histStart = endRevision;        		histEnd = startRevision;        	}else{                    	    histStart = startRevision;                histEnd = endRevision;            }       	            	/* If paths were specified, then we only really care about revisions            *  in which those paths were changed.  So we ask the filesystem for            *  all the revisions in which any of the paths was changed.            *              *  SPECIAL CASE: If we were given only path, and that path is empty,            *  then the results are the same as if we were passed no paths at            *  all.  Why?  Because the answer to the question "In which            *  revisions was the root of the filesystem changed?" is always            *  "Every single one of them."  And since this section of code is            *  only about answering that question, and we already know the            *  answer ... well, you get the picture.*/        	long sendCount = 0;        	if(targetPaths == null || (targetPaths.length == 1 && "".equals(targetPaths[0]))){        		sendCount = histEnd - histStart + 1;        		if(limit != 0 && sendCount > limit){        			sendCount = limit;        		}                int count = 0;                int reallyHandled = 0;        		for(count = 0; count < sendCount; count++){        			long rev = histStart + count;        			if(startRevision > endRevision){        				rev = histEnd - count;        			}        		                    if(handler != null){                        FSWriter.sendChangeRev(myReposRootDir, myRevNodesPool, rev, discoverChangedPath, handler);                        reallyHandled++;                    }        		}                return reallyHandled;        	}            /*make all coming path absolute*/            ArrayList absPaths = null;            if(targetPaths != null){                absPaths = new ArrayList(0);                for(int count = 0; count < targetPaths.length; count++){                    absPaths.add(getRepositoryPath(targetPaths[count]));                }            }        	ArrayList histories = new ArrayList(0);        	for(int count = 0; count < absPaths.size(); count++){        		String thisPath = (String)absPaths.get(count);        		//FSRevisionNode root = myRevNodesPool.getRootRevisionNode(histEnd, myReposRootDir);        		        		FSRoot root = FSRoot.createRevisionRoot(histEnd, myRevNodesPool.getRootRevisionNode(histEnd, myReposRootDir));                FSNodeHistory hist = null;        		/*if there is no path at specified root, SVNException is thrown*/                hist = FSNodeHistory.getNodeHistory(myReposRootDir, root, thisPath);                LogPathInfo info = new LogPathInfo(hist);        		info.pickUpNextHistory(myReposRootDir, strictNode, histStart);        		histories.add(info);        	}        	boolean anyHistLeft = true;        	ArrayList revsArr = null;            boolean firstCycleIteration = false;        	for(long current = histEnd; current >= histStart && anyHistLeft; ){        		        		long nextRev = FSConstants.SVN_INVALID_REVNUM;        		boolean changed = false;        		anyHistLeft = false;                /*calculating next value for 'current'*/                /*first iteration must be with histEnd value*/                if(firstCycleIteration){                    for(int count = 0; count < histories.size(); count++){        			        			    LogPathInfo info = ((LogPathInfo)histories.get(count));        			    if(info.getHistory() == null){        			        continue;        			    }        			    if(info.getHistoryRevision() > nextRev){        			        nextRev = info.getHistoryRevision();        				        			    }        			        		    }                    current = nextRev;                }                       firstCycleIteration = true;                boolean changedFlag = false;        		for(int count = 0; count < histories.size(); count++){        			LogPathInfo info = ((LogPathInfo)histories.get(count));        	        /* Check history for this path in current rev. */                    changed = info.checkHistory(myReposRootDir, current, strictNode, histStart);                    if(changed){                        changedFlag = true;                     }        			if(info.getHistory() != null){        				anyHistLeft = true;        			}        		}        		if(changedFlag == true){        			if(startRevision > endRevision){                         if(handler != null){                            FSWriter.sendChangeRev(myReposRootDir, myRevNodesPool, current, discoverChangedPath, handler);                            sendCount++;                        }        				if(limit != 0 && sendCount >= limit){        					break;        				}        			}else        			{        				if(revsArr == null){        					revsArr = new ArrayList(0);        				}	        				revsArr.add(new Long(current));        			}        		}        	}            int count = 0;            int reallyHandled = 0;        	if(revsArr != null){                        		for(count = 0; count < revsArr.size(); count++){                    if(handler != null){                        FSWriter.sendChangeRev(myReposRootDir, myRevNodesPool, ((Long)revsArr.get(revsArr.size() - count - 1)).longValue(), discoverChangedPath, handler);                        reallyHandled++;                    }        			if(limit != 0 && count + 1 >= limit){        				break;        			}        		}                return reallyHandled;        	}            return sendCount;                	}finally{    		closeRepository();    	}    }    