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"
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.
"""
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?
Thank you.
- Julian Foad