Click here to Skip to main content
15,881,744 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to merge different branches into the trunk branch. I want to check if a conflict exists before merging the branches. If there is a conflict with a branch that merge operation will not be carried out. How can I achieve this?

What I have tried:

I have tried this till now.
C#
SvnMergeArgs args=new SvnMergeArgs();
args.DryRun=true;
bool result=client.merge(targetPath,src_url,revision_range,args);

It is always giving me true in `result` variable but I know there is a conflict in the branch.
Posted
Updated 7-Jul-20 20:21pm
Comments
Patrice T 8-Jul-20 3:12am    
What make you think that this site is support service for that product ?

1 solution

I think you can do this
args.Conflict += new EventHandler<SvnC​onflictEventArgs>​(args_Conflict)​;
where args_Conflict is
static void args_Conflict(object sender, SvnConflictEventArgs e)
{
  // Do Something with the conflict 
  // - does this give [public enum class SvnConflictReason] for example 
}
where
402	public enum class SvnConflictReason
403	{
404		/// <summary>local edits are already present</summary>
405		Edited	= svn_wc_conflict_reason_edited,
406		/// <summary>another object is in the way</summary>
407		Obstructed = svn_wc_conflict_reason_obstructed,
408		/// <summary>object is already schedule-delete</summary>
409		Deleted = svn_wc_conflict_reason_deleted,
410		/// <summary>object is already added or schedule-add</summary>
411		Added = svn_wc_conflict_reason_added,
412		/// <summary>object is unknown or missing</summary>
413		Missing = svn_wc_conflict_reason_missing,
414		/// <summary>object is unversioned</summary>
415		NotVersioned = svn_wc_conflict_reason_unversioned
416	};


also see : c# - SharpSVN.Merge() Not Working, Returns true But not able to see changes in Code - Stack Overflow[^]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900