How to make SourceTree prompt for conflict files in a merge?

Hi Everyone,

We had a very odd behavior a couple of days ago using SourceTree and Mercurial to merge some files from our 'develop' to 'feature' branch. We would like to know if anyone has passed the same problem or if there's any available solution for that.

The problem apparently happens when we merge our Develop to Feature branch. If a certain file was removed from 'develop' but still exist in the 'feature' and was modified, SourceTree ignore the removed file and keep the old reference not displaying any conflict. However if we merge using mercurial commands by the terminal, it prompts correctly the conflicts resolution and merge the files as expected.

Does anyone has faced a similar situation or have any idea how to overcome this issue using SourceTree? Any help will be welcome.

4 answers

This widget could not be displayed.

All SourceTree does is call 'hg merge' on the command line anyway, so I'm curious how it could have behaved differently. Have you tried comparing the commands that SourceTree issued to the command you performed on the command line? Is there any chance the hg versions could have been different, say if you're using the embedded hg in SourceTree but a different version installed elsewhere?

This widget could not be displayed.

The hg version that I'm using for test is the one that comes embbeded on the SourceTree (2.2.2) located in "/Applications/SourceTree.app/Contents/Resources/mercurial_local/hg_local". SourceTree is not prompting the conflicts regarding the removed files as it suppose to do.

This widget could not be displayed.

Looking at the SourceTree console output, I noticed it issues the merge command(as you can see just in underneath) and it logs the removed files. However it does not mark the files as modified or conflicted and do not take any action at all. This is totally wrong once the files are different at that stage. In other words, if you are not running SourceTree with a console output you will never know what is really going on. Aside from that you still have to do the merge manually and find out the modified/conflicted files once SourceTree U.I will not indicate in case the files has been removed.

SourceTree Command

hg merge -y merge-tools.sourcetreebulkmerge.priority=999999 642

hg command by terminal

hg merge 642

About the hg version I'm running by terminal, that is the version that comes embedded on the SourceTree (2.2.2) located in "/Applications/SourceTree.app/Contents/Resources/mercurial_local/hg_local".

I'm still looking for a solution on regarding to this matter.

Thanks.

It's possible that the merge helper is making this particular merge behave differently to the default command line, but I'm surprised it hasn't come up before. I've logged a bug for my colleague who looks after the Mac version to take a look at: https://jira.atlassian.com/browse/SRCTREE-1619

This widget could not be displayed.

Sorry if my previous posts were misleading but I don't think it is a bug. Let me try to clarify my point. Loking at the log files, I think what happens when you merge two different branches and a file has been removed from a branch and modified in another one is that SourceTree keep the modified file by default.


Please find my log sample just in underneath that sustains my previous statement.

hg merge -y merge-tools.sourcetreebulkmerge.priority=999999 642
local changed /data/File1.as which remote deleted
use (c)hanged version or (d)elete? c
local changed /data/File2.as which remote deleted
use (c)hanged version or (d)elete? c
local changed /data/File3.as which remote deleted
use (c)hanged version or (d)elete? c


At the moment, for what I can see the only way to deal with this problem, is turn on the option on the preference panel to always display the console output for every operations. While this is not a wrong behavior as I said priorly, I guess it's not an ideal approach in all cases.


As an enhancement, I have 2 different suggestions to deal with this problem:

1 - The first one and the best in my point of view, would be having an extra option(probably a checkbox on the preference panel) that when checked, it would prompt the user on how it would like to solve the merge, keeping or removing the files. The current behavior could still be kept by default when the checkbox is not selected.

2 - The second one could simply notify the user at the end of the merge with a list of files that have been kept while they were deleted on the parent branches.


I hope I have clarified my point and provided useful information that can help in some way. In case I was not clear enough at some point or I'm missing anything, please just let me know about that and I will try to put it in place as fast as possible.

Thank you very much.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Thursday in United States

Local Atlassian Research Workshop opportunity on Sep. 28th

We're looking for participants for another workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sh...

48 views 0 0
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you