Compare Working Copy with Working Base for Unmodified file

322 views
Skip to first unread message

Tim

unread,
Aug 28, 2023, 10:01:44 AM8/28/23
to TortoiseSVN
Hi TortoiseSVN support team,

I have TortoiseSVN and WinMerge installed and have setup WinMerge as the diff tool for TortoiseSVN. Today, I am taking over changes between 2 folders compared with WinMerge over to a working copy of a branch with different SVN history. I am using the mentioned WinMerge window on one monitor to go through the modified code lines. In parallel, I have a TortoiseSVN - Check For Modifications window open and try to modify the files in it adding the changes found in the WinMerge window. To see all files in the TortoiseSVN window, I checked the box for showing the unmodified files. When I double-click an unmodified file in this view, it opens a WinMerge comparison window with the file. WinMerge then displays that the same file is open on both sides and is compared. The left side has as title the file name and "Working base", while on the title on the right is the file name and "Working copy". When I add changes on the "Working Copy" side and then save it, WinMerge then notifies twice that the file has changed and asks whether it shall load the new version. I confirm with "Yes" both times. Afterwards, there are no difference between the sides shown. Is this wanted and expected behavior?
If it is, can there be, or is there, a TortoiseSVN setting, something like a checkbox in the TortoiseSVN global settings, that would store a copy of the "Working base" file somewhere and then let WinMerge compare that copy against the Working copy file, with the intent that the changes are highlighted and visible in WinMerge when changing the contents of the Working copy file within WinMerge?
Thanks,
Tim

Brad Porter

unread,
Aug 30, 2023, 10:50:32 AM8/30/23
to TortoiseSVN
Hello Tim and valued TortoiseSVN support volunteers,

Interesting... I came to the forums today to report a "bug" where a temporary file is created when I don't want one ("Compare two files"), and your "bug" is that a temporary file is not created when you do want one (diff an unmodified file). Both of these affect users that edit files in their diff tool.

I have run into this "bug" (quotes because it is really just "the current behavior") and I agree that it would be better if TortoiseSVN used a read-only temporary copy of the unmodified file on the left side of the compare, and the file on disk on the right side (like it does if the file was already modified).

It seems that many developers do not ever edit files in their diff tools, so these "bugs" would never be noticed by them. I frequently edit or manually synchronize file contents in my diff tools (Beyond Compare, Helix P4Merge, and WinMerge).

 Brad

Stefan

unread,
Aug 30, 2023, 1:11:17 PM8/30/23
to TortoiseSVN
There's a reason a temp file is created:
the 'real' file might have svn:keywords expanded or might have other EOLs. SVN won't show such files as different from the ones in the repository. But they are different when passing them to a diff tool.
So by default, the file to be diffed is first converted so that the keywords are removed and EOLs adjusted, that file is then saved to a temp file so it can be used by the diff tool.

you can disable this behavior it it bothers you: settings dialog->Diff Viewer->convert files when diffing against BASE

Tim

unread,
Sep 1, 2023, 12:54:17 PM9/1/23
to TortoiseSVN
I think Brad understands my problem. @Stefan, you do not seem to. My problem is that when comparing Working Copy against BASE, that the comparison tool WinMerge gets the same file on both sides from TortoiseSVN. When I then try to edit the Working Copy in the comparison tool, it seems to also edit the BASE, which is screwing up the comparison between the BASE version that was originally there and the now modified "Working Copy" file. In fact, the file passed to WinMerge by TortoiseSVN is the file in the check out folder structure and not any temporary file, created by TortoiseSVN because of diffing.

Daniel Sahlberg

unread,
Sep 3, 2023, 3:59:22 PM9/3/23
to TortoiseSVN
fredag 1 september 2023 kl. 18:54:17 UTC+2 skrev Tim:
I think Brad understands my problem. @Stefan, you do not seem to. My problem is that when comparing Working Copy against BASE, that the comparison tool WinMerge gets the same file on both sides from TortoiseSVN. When I then try to edit the Working Copy in the comparison tool, it seems to also edit the BASE, which is screwing up the comparison between the BASE version that was originally there and the now modified "Working Copy" file. In fact, the file passed to WinMerge by TortoiseSVN is the file in the check out folder structure and not any temporary file, created by TortoiseSVN because of diffing.

So what you basically are suggesting is that TortoiseSVN should make a copy of the un-changed file to use as "left hand side" and the actual file on the "right hand side"?

It should be a fairly trivial change, but I haven't analysed if there may be pitfalls in this change.

Kind regards,
Daniel 

Tim

unread,
Sep 4, 2023, 9:51:17 AM9/4/23
to TortoiseSVN
Yes, that's correct.
Reply all
Reply to author
Forward
0 new messages