Doing a diff from Log Messages causes an SVN assertion in offline mode

89 views
Skip to first unread message

Daniel Sahlberg

unread,
Dec 16, 2020, 2:46:31 AM12/16/20
to TortoiseSVN-dev
An error was reported in the Subversion Users mailing list regarding an assertion thrown in TortoiseSVN (https://mail-archives.apache.org/mod_mbox/subversion-users/202011.mbox/%3CPH0PR11MB4789BCA6DF5CB62E5198CBA491E20%40PH0PR11MB4789.namprd11.prod.outlook.com%3E).

The basic premisis is that the server is not currently reachable and the user has selected to be offline. In the original report there was a VPN involved but it doesn't matter why the server is unreachable, when investigating I modified the DNS resolution by inserting a fake entry in the c:\windows\system32\drivres\etc\hosts file.

I have dug into this and it seems to originate in CLogDlg:DoDiffFromLog. The call to GetRepositoryRoot (line 2855) return differently depending on whether the server is available (https://server.url/svn/trunk/test.txt) or not (blank). Following the code it seems that GetRepositoryRootAndUUID tries to call svn_client_get_repos_root, which fail because the server is not available.

If I fake the return value from GetRepositoryRoot I will end up with an error "Unable to connect to a repository at URL https://server.url/svn/trunk/test.txt".

Summary
Is it reasonable that it is possible to "Show changes" from the Log dialog when in offline mode since we would not be able to get the files from the server anyway?
If reasonable, could the error from svn_client_get_repos_root be handled differently to avoid setting filepath empty and thus avioding the assertion later on?

Kind regards
Daniel Sahlberg

Stefan

unread,
Dec 17, 2020, 1:36:40 PM12/17/20
to TortoiseSVN-dev
fixed in r29043

Daniel Sahlberg

unread,
Dec 17, 2020, 4:24:11 PM12/17/20
to TortoiseSVN-dev
Thank you, I can confirm that this avoid the assertion. I now get the error message "Could not retrieve URL of the file".

However I thinkt that error message might cause confusion amont users as to what the actual error is.

In my test case I have two revisions, one add and then one modification. It is when I try to view the diff from the modification I end up in the above code path.

If I try to show changes from the add (which obviously doesn't have a change, but it should show the initial version of the file, I get the following error message which is a bit better - at least it reports that the server is unreachable. (Sorry about the Swedish in the last line, it says No connection could be made because the target machine actively refused it).


I still believe that many of the commands doesn't make much sense in offline mode. Or is the idea that there could be a local cache also of the old revisions?
torsdag 17 december 2020 kl. 19:36:40 UTC+1 skrev Stefan:
fixed in r29043

Daniel Sahlberg

unread,
Jan 4, 2021, 11:04:06 AM1/4/21
to TortoiseSVN-dev
I saw the further change in r29044 and I would just like to say that it seems much better now. Thanks for your support!
Reply all
Reply to author
Forward
0 new messages