Merge and Conflict Question

View: New views
3 Messages — Rating Filter:   Alert me  

Merge and Conflict Question

by Scott Carter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

I am having trouble understanding how the library determines conflicts in merges.  I am interested in merging 2 branches together, and for the trivial cases let the library resolve the conflicts, and for conflicting cases mark the files to pass to our diff program.  The problem is the library is merging everything, even when there are different changes to the same line of the file.  Here is what I am doing:

 

  • create a branch from an existing branch
  • Change the same file on the 2 different branches, at the same line of the file (this should not auto merge, correct?)
  • Run the doMerge method from the library.  (I have tried 3 different variations of the doMerge method, File to URL, URL to file, and URL to URL)

 

The library just takes the changes on one branch and overwrites it to the location of the dstFile.  It does not mark this as a conflicting case.  I am running with recursive set to true, useAncestry set to true, force set to false and dryRun set to false. 

 

Basically what I need to accomplish is to merge the source of 2 SVNURLs and have the output go to the dstFile.  In cases where a certain file has changed on both branches then the merge should resolve it unless there is a conflict (same or very close lines changed on both branches for the same file).  In cases where there are changes to the same file on both branches, I need it to create the local, left and right files so that I can send these into a diff program. 

 

What am I doing wrong?  Please help. 

 

Scott A Carter

Software Configuration Management Engineer

Conexant E-mail Firewall (Conexant.Com) made the following annotations
---------------------------------------------------------------------
********************** Legal Disclaimer **************************** "This email may contain confidential and privileged material for the sole use of the intended recipient. Any unauthorized review, use or distribution by others is strictly prohibited. If you have received the message in error, please advise the sender by reply email and delete the message. Thank you." ********************************************************************** ---------------------------------------------------------------------


Re: Merge and Conflict Question

by Alexander Sinyushkin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello, Scott.

Looks like there's a bug in SVNKit but I'm not absolutely sure. Can you
please try the same with the Subversion itself? Does it produce a
conflict in your situation?

----
Alexander Sinyushkin,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

Scott Carter wrote:

> I am having trouble understanding how the library determines conflicts
> in merges.  I am interested in merging 2 branches together, and for the
> trivial cases let the library resolve the conflicts, and for conflicting
> cases mark the files to pass to our diff program.  The problem is the
> library is merging everything, even when there are different changes to
> the same line of the file.  Here is what I am doing:
>
>  
>
>     * create a branch from an existing branch
>     * Change the same file on the 2 different branches, at the same line
>       of the file (this should not auto merge, correct?)
>     * Run the doMerge method from the library.  (I have tried 3
>       different variations of the doMerge method, File to URL, URL to
>       file, and URL to URL)
>
>  
>
> The library just takes the changes on one branch and overwrites it to
> the location of the dstFile.  It does not mark this as a conflicting
> case.  I am running with recursive set to true, useAncestry set to true,
> force set to false and dryRun set to false.
>
>  
>
> Basically what I need to accomplish is to merge the source of 2 SVNURLs
> and have the output go to the dstFile.  In cases where a certain file
> has changed on both branches then the merge should resolve it unless
> there is a conflict (same or very close lines changed on both branches
> for the same file).  In cases where there are changes to the same file
> on both branches, I need it to create the local, left and right files so
> that I can send these into a diff program.
>
>  
>
> What am I doing wrong?  Please help.
>
>  
>
> Scott A Carter
>
> Software Configuration Management Engineer
>
> Conexant E-mail Firewall (Conexant.Com) made the following annotations
> ---------------------------------------------------------------------
> ********************** Legal Disclaimer ****************************
> "This email may contain confidential and privileged material for the
> sole use of the intended recipient. Any unauthorized review, use or
> distribution by others is strictly prohibited. If you have received the
> message in error, please advise the sender by reply email and delete the
> message. Thank you."
> **********************************************************************
> ---------------------------------------------------------------------
>

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@...
For additional commands, e-mail: svnkit-users-help@...


Re: Merge and Conflict Question

by Marc Farrow :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alexander Sinyushkin-2 wrote:
Does it produce a conflict in your situation?

I have the same problem. I was able to create the conflict using the command line version of SVN on windows. However, when I do the same merge using SVNKit, there is no conflict. The change I am merging into my working copy gets accepted. I have a feeling that even though Alexander is the expert and it could be a bug in SVNKit, I think the problem is more of a user problem (I.E. my ignorance). So let me explain a bit more in detail what I am doing with SVNKit and please someone help me produce the desired results.

Using command line SVN:
I have a branch (called trunk). I edit line some random line in a file (let's say line 4 for a point of reference). I commit (revision 49) the changes and delete the working copy.


Using command line SVN:
I checkout another branch (called branch1). I edit line 4 in the same file with different information. I commit (revision 50) the changes and delete the working copy.


Next I have a Java program that is using SVNKit. The rest of my process involves using Java and SVNKit exclusively (thus no longer using command line client).

In the code I create a working copy of "branch1". I then use my DiffClient and called DoMerge on the "trunk" branch using the URL.

Here is where I believe my problem is. I think I am using wrong revision numbers for the merge. By the time I get to SVNKit program, I do not have any clue what my revision numbers are. I just have the labels to the copies in the repository that I want to merge. For sake of completeness and maybe to help people respond I did state the revision number of repository above for each commit.

Here is the API I am using:
  public void doMerge(File path1,
SVNRevision revision1,
SVNURL url2,
SVNRevision revision2,
File dstPath,
boolean recusrsive,
boolean useAncestry,
boolean force,
boolean dryRun)
throws SVNException


Here is my actual call:
  File workingDirectory;
SVNURL mergeURL;
SvnRevision workingRevision; // value is retrieved during checkout.
...
diffClient.doMerge(workingDirectory,
workingRevision,
mergeURL,
SVNRevision.HEAD,
workingDirectory,
true,false,false,false