So yes, there is a small bug in TSVN here. But please see inline because
even with the bug resolved, the issue still remains...
On Friday, January 10, 2020 at 4:13:43 PM UTC+1, Julian Foad (Assembla)
wrote:
>
> SUMMARY:
>
> The "revert changes" option in the log viewer's changed paths list
> throws an error "Unable to reconstruct working copy path", when there is
> a URI-encoded "^" character in the repository root URL.
>
> We (Assembla) use repository root URLs containing a caret character
> ('^', '%5E') for many repositories; it is not something we could easily
> avoid. I am sending this report on behalf of a customer who ran into
> the problem when moving their repository onto our hosting. From their
> point of view it looks like a problem with our hosting, which is awkward.
>
> SYSTEM INFO:
>
> - TSVN 1.13.1 (also seen on 1.12.2 and 1.10.5)
>
> - Repository root URL contains a (URI-escaped) "^" character.
> Repo URLs used in production are in this form:
> https://subversion.assembla.com/svn/something%5Esomething
> Repo URLs used for reproducing this bug:
> file:///C:/something/something%5Esomething
>
> - Svn server version: is the SVN client library version in TSVN, when
> reproducing with a local file:// URL.
>
> STEPS TO REPRODUCE:
>
> Create a repo and checkout a WC using this script (also attached as
> 'revertchanges1.bat.txt'):
> [[[
> set "REPO_DIR=C:\svn-test-dir\repo1^^A"
> set "REPO_URL=file:///C:/svn-test-dir/repo1^^A"
> set "WC_DIR=C:\svn-test-dir\wc1"
>
> mkdir c:\svn-test-dir
> svnadmin create %REPO_DIR%
> svn checkout %REPO_URL% %WC_DIR%
> cd %WC_DIR%
> svn mkdir trunk
> echo "hello" > trunk/file.txt
> svn add trunk/file.txt
> svn commit -m "Add a file"
> echo "changed" > trunk/file.txt
> svn commit -m "Modify a file"
> cd C:\svn-test-dir\wc1\trunk
> svn del file.txt
> svn commit -m "Delete a file"
>
here, you're deleting the c:\svn-test-dir\wc1\trunk\file.txt file. So it
does not exist in HEAD anymore.
>
> svn info
> ]]]
>
> In the folder 'C:\svn-test-dir\wc1', using TSVN:
> - open the context menu on the 'trunk' entry
> - select 'Show log'
> In the Log Messages dialog:
> - select revision 2 ('Modify a file'),
> - open context menu of changed-path 'file.txt' (Action is 'Modified')
> - select 'Revert changes from this revision'
>
> EXPECTED RESULT:
>
> - TSVN should display a "Reverting changes" confirmation dialog.
>
> ACTUAL RESULT:
>
> - TSVN displays an error dialog, saying,
> """
> Something went wrong
> Unable to reconstruct working copy path!
> This can happen if the file has been renamed.
> Please start the log dialog on this specific file alone and then
> revert the changes from the top pane in the log dialog.
> """
>
>
Since the file.txt does not exist anymore, you can not revert changes from
revision 2: in that revision, file.txt was modified. So you can not undo
those modifications to a file that doesn't exist anymore.
As the dialog shown explains: you have to revert not just rev 2 but from
HEAD up (and including) r2.
> INVESTIGATION:
>
> The result is also the same if we select a changed path with Action =
> 'Added' (r1 in the repro).
>
> If we select a changed path with Action = 'Deleted' (r3 in the repro),
> then we get a different result with a clue in it:
> """
> Reverting changes
> Do you want to revert all changes in
> C:\svn-test-dir\w%5EA\trunk\file.txt
> which were made in this revision?
> """
>
> In this test case the WC root path was
> C:\svn-test-dir\wc1
> the WC folder containing the selected file "File1.txt" was
> C:\svn-test-dir\wc1\trunk
> the repo URL of that folder was
> file:///C:/svn-test-dir/repo1%5EA/trunk
>
> It looks like the WC path was constructed wrongly, including not enough
> of the WC root path or selected folder path, and including too much of
> the repository URL.
>
> The relevant source code is in LogDlg.cpp:
>
>
> https://osdn.net/projects/tortoisesvn/scm/svn/blobs/28686/trunk/src/TortoiseProc/LogDialog/LogDlg.cpp
>
>
> The error dialog is displayed in ExecuteRevertChangedPaths, line 7416.
> The bad WC path 'pCmi->wcPath' is constructed in
> GetContextMenuInfoForChangedPaths starting at line 7110.
>
> It looks like it is comparing a URI-encoded 'fileUrl' against a
> non-encoded 'sUnescapedUrl'.
>
> Although I can read the source code, I don't have a development/debug
> environment available to examine the variables or develop a fix.
>
> Can anyone please confirm this and/or fix it?
>
>
correct observation of the bug. It's indeed the mismatched comparison of
unescaped and escaped urls that's the problem. But as mentioned above:
reverting changes for a file that does not exist anymore in the wc is not
possible.
fix committed in r28713
Stefan
--
You received this message because you are subscribed to the Google Groups
"TortoiseSVN" 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/804be91b-fe0c-4bb8-acec-5bb15913cd4c%40googlegroups.com.