简体   繁体   中英

How to Get a Log Between Two Branches Using SvnKit?

I have a branch structure like this . How can I get an svn log between two revisions in different branches using SvnKit (for example, a revision from branch 5A.1 and a revision from branch 2B.3 ), excluding already merged revisions? I know, how to do it inside single branch using SvnLog operation:

// factory - SvnOperationFactory instance
SvnLog svnLog = factory.createLog();
// target - SvnTarget instance, created from branch URL
// using SvnTarget.fromURL(SVNURL.parseURIEncoded(branchPath))
// my problem is there: how to tell svnLog that I need a diffrence 
// between two different branches?
// Adding a second target won't solve my problem, I suppose
svnLog.addTarget(target);
// if you need to go deeper in history, set to "false"
// if you looking for revisions only inside this branch, set to "true" 
svnLog.setStopOnCopy(stopOnCopy);
// if you need to include merged revisions too
svnLog.setUseMergeHistory(useMergeHistory);
SVNRevision startRev = SVNRevision.create(startRevNumber);
SVNRevision endRev = SVNRevision.create(startRevNumber);
svnLog.addRange(SvnRevisionRange.create(startRev, endRev));
// the limit of SvnLogEntry items
svnLog.setLimit(limit);
return svnLog.run(null);

There is some kind of misunderstanding that I can't handle with. SvnKit version is 1.8.7

Most likely you should use SvnLogMergeInfo . Check out this solution:

How to use SVNKit to get the list of all revisions merged from one branch to another?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM