Ticket #19 (defect)
Opened 3 years ago
Last modified 3 years ago
item pathes with a ~ character are not handled correctly
Status: closed (fixed)
| Reported by: | luedi | Assigned to: | toby |
|---|---|---|---|
| Priority: | major | Milestone: | 0.10-beta-1 |
| Component: | vss2svn.pl | Version: | 0.10.0 |
| Keywords: | Cc: | ||
If you add a file that have a tilde character in the file name, the resulting item path does only reflect the characters before the the ~ character.
This can easily happen if you add files to ss from a dos client that where mangled with the ~1 syntax. Within the phyiscal file of the newly added item, only the part before the tilde character is stored. The correct name with the tilde character can be found in all three slots in the then name cache.
The GetItemName? function currently rejects the name from the name cache, if the name from the physical file does not contain a ~, but the one in the name cache does contain one.
This will lead to import problems later, since multiple files will be mapped to the same item path, e.g
ss add testfi~1.txt ss add testfi~2.txt
will be mapped to
add /testfi add /testfi
Change History
03/29/2006 05:57:54 PM: Modified by toby
- status changed from new to assigned.
03/29/2006 05:59:22 PM: Modified by toby
03/30/2006 01:35:25 AM: Modified by luedi
No, not fully. The fix in #1 will correctly identify the right name from the name cache. In this case the name with the tilde is mapped to all three slots in the name cache. So actually you have for the example above:
<NameCacheEntry offset="292">
<Entry id="1">testfi~1.cpp</Entry>
<Entry id="2">testfi~1.cpp</Entry>
<Entry id="3">testfi~1.cpp</Entry>
<NrOfEntries>3</NrOfEntries>
</NameCacheEntry>
...
The fix in #1 will only select the id="2" as the real name. But this is dropped again in the GetItemName? function, since it contains a "~" and the real name from the physical item does not:
<?xml version="1.0" encoding="windows-1252" ?>
<File Name="test8\data\f\faaaaaaa">
<ItemInfo offset="52">
<SSName offset="229" type="file">testfi</SSName>
<NumberOfActions>1</NumberOfActions>
<LatestExt>.A</LatestExt>
<DataFileName>test8\data\f\faaaaaaa.A</DataFileName>
<Type>2</Type>
...
My Hotfix for #1 currently always extract a name from the cache, if an item name is available, also when only one slot is occupied. This was important for projects, but is problematic for files. For example if the item name does not contain special characters, but is only longer than 8.3, only the first slot is set with the mangled dos 8.3 name:
> ss add TestFileWithoutSpecialCharacters?.txt
<NameCacheEntry offset="346">
<Entry id="1">testfi~3.txt</Entry>
<NrOfEntries>1</NrOfEntries>
</NameCacheEntry>
Fixing GetItemName? with this Hotfix would always return the mangled name.
So in order to solve this issue, both functions must be adjusted, #1 is a precondition.
04/04/2006 10:03:11 PM: Modified by toby
- status changed from assigned to closed.
- resolution set to fixed.
Fixed in r171.

I believe the suggested fix to #1 will also resolve this ticket.