Prompted by the discussion in the users group [1], I've been investigating 
why the prompt to merge doesn't appear sometimes.

When merging with a specified range, CSVNProgressDlg::CmdMerge() is used 
while merging without a range (or All revisions) is 
using CSVNProgressDlg::CmdMergeAll().

CSVNProgressDlg::CheckUpdateAndRetry() should check if an update is 
required:
    if (GetSVNError() && GetSVNError()->apr_err == 
SVN_ERR_CLIENT_MERGE_UPDATE_REQUIRED)
        ... prompt the user to update or cancel ...

In CmdMerge, the call to GenerateMergeLogMessage() (line 3384) seems to 
reset the latest error (SVNBase::m_err) so GetSVNError() will return false.

A naive fix would be to condition the call to GenerateMergeLogMessage() 
with if (!bFailed), however that is a direct revert of r27728 "Generate the 
merge log message even if the merge returned with an error: a merge 
conflict also returns an error.".

I'm instead considering to check GetSVNError() and the actual error message 
but I don't have enough knowledge about the different error messages that 
could appear.

Ideally, I'd like to do check for a list of error messages that indicate a 
merge failure and create a log message in these cases (it seems unneccesary 
to create a log message in case of a network failure). Unfortunately I 
don't know how to figure out this list of error messages.

Another option would be to check for only 
SVN_ERR_CLIENT_MERGE_UPDATE_REQUIRED. That would solve the current bug but 
could open up for other bugs in the future if/when we want to look for 
other error messages later in the code.

Any opinion on this?

On a side note, CmdMergeReintegrate() (and CmdMergeReintegrateOldStyle() 
and  CmdMergeReintegrateOldStyle()) should probably also be changed to run 
GenerateMergeLogMessage() in case of a merge conflict to give similar 
behaviour in all kind of merges.

Kind regards,
Daniel



[1] https://groups.google.com/g/tortoisesvn/c/i15g_7BYhgI

-- 
You received this message because you are subscribed to the Google Groups 
"TortoiseSVN-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tortoisesvn-dev/d1608ebc-829c-42d7-bf37-d1a7d69539f4n%40googlegroups.com.

Reply via email to