Personally I've done at least 4 merges using this very code, and each one worked, outputting each file as it merged. I've even done a dryRun merge and still seen the output. Do be aware that, at least for me, merge takes a *very* long time for projects with more than, say, 20 files changed. This includes the time that it takes between when it first invokes the merge command and when it starts reporting back changes. If you have not threaded it, you should notice this, as program execution doesn't resume until after the merge command completes. If you have threaded it, maybe put some kind of indicator of when it finishes so that you know whether it's working or finished. Also, be aware that event.getAction().toString() is exactly the same as the doUpdate events. Personally, I perform a merge after an update, so if you're printing the event.getAction, it's very easy to think that it's still updating when it's actually merging.
-IsmAvatar On Wed, Aug 17, 2011 at 12:59 PM, akromm <[email protected]> wrote: > > Hi, I am also trying to do this. I implemented ISVNEventHandler and > registered it in my SVNDiffClient but the handleEvent() method isn't being > called ever, only the checkCancelled method gets called. > > > for now I made the implementation really simple: > > > public class MergeEventHandler implements ISVNEventHandler { > > @Override > public void handleEvent(SVNEvent event, double progress) throws > SVNException { > System.out.println("handle event was called..."); > } > > @Override > public void checkCancelled() throws SVNCancelException { > System.out.println("Check cancelled was called"); > } > } > > > As I said, handleEvent never gets called. I register it like this: > > > cm = SVNClientManager.newInstance(); > dc = cm.getDiffClient(); > dc.setEventHandler(new MergeEventHandler()); > > > and the doMerge function that I'm calling is: > > public void doMerge(SVNURL url1, > SVNRevision revision1, > SVNURL url2, > SVNRevision revision2, > File dstPath, > SVNDepth depth, > boolean useAncestry, > boolean force, > boolean dryRun, > boolean recordOnly) > throws SVNException > > > Am I doing something wrong or am I missing something? > > -Adam. > > > Alexander Sinyushkin wrote: >> >> Hello, >> >> Yes, you're doing this right.When passing dryRyn=true, no real content >> changes are performed, >> but still all SVNEvents that would come out in a normal case (not a dry >> run) are passed to >> the registered ISVNEventHandler as well. So, you need to implement your >> own ISVNEventHandler >> and pass it to SVNDiffClient (through its setEventHandler() setter). In >> the handleEvent() method of >> your handler you should look through event actions which SVNKit sends >> you in >> SVNEvent.getAction():SVNEventAction. If a merge causes a tree-conflict, >> you'll get SVNEventAction.TREE_CONFLICT, >> to find out if there's a text or prop conflict, you have to check >> SVNEvent.getContentsStatus() and SVNEvent.getPropertiesStatus() >> for SVNStatusType.CONFLICTED\SVNStatusType.CONFLICTED_UNRESOLVED while >> SVNEvent.getAction() can be any of >> SVNEventAction.UPDATE_*. I hope the idea is clear. >> >> ---- >> Alexander Sinyushkin, >> TMate Software, >> http://svnkit.com/ - Java [Sub]Versioning Library! >> http://sqljet.com/ - Java SQLite Library! >> >> >> >> chathu wrote: >>> Hi, >>> >>> My svnkit version is 1.3.0. I used doMerge to mergr resository file to >>> the >>> local copy. I used fallowing method. >>> >>> doMerge(SVNURL url1,SVNRevision revision1,File path2,SVNRevision >>> revision2,File dstPath,SVNDepth depth,boolean useAncestry,boolean >>> force,boolean dryRun,boolean recordOnly)throws SVNException >>> >>> Also I need to first check if this file is conflicted. If it is not >>> conflicted I need to continue the merge. else stop this operation and >>> perform another operation. >>> >>> So I put dryrun as true. >>> >>> I need to know how can I get a output from this. I couldn't find any out >>> parameters or any handlers. >>> >>> I need to know is there any wrong in my approach. Please mention is there >>> any alternative way to satisfy my requirement. >>> >>> Thank you, >>> Regards, >>> Chathurika. >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> >> > > -- > View this message in context: > http://old.nabble.com/How-to-use-dryrun-of-SVNDiffClient.doMerge-method-tp25779766p32281415.html > Sent from the SVNKit - Users mailing list archive at Nabble.com. > > >
