root icon indicating copy to clipboard operation
root copied to clipboard

[tree] fix duplicated anchor in filename

Open ferdymercury opened this issue 7 months ago • 1 comments

This Pull request:

Changes or fixes:

Fixes https://its.cern.ch/jira/browse/ROOT-5002

Checklist:

  • [x] tested changes locally
  • [ ] updated the docs (if necessary)

ferdymercury avatar May 23 '25 10:05 ferdymercury

Test Results

    21 files      21 suites   3d 13h 31m 38s ⏱️  3 691 tests  3 691 ✅ 0 💤 0 ❌ 75 903 runs  75 903 ✅ 0 💤 0 ❌

Results for commit 45b62ea3.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 23 '25 17:05 github-actions[bot]

Apologies, I'm trying to understand better what this PR is solving. I can't see from the original issue or from the new reproducer what was the previously broken situation, e.g. what was the file name? In the original issue I read

The method TEntryList::GetEntryList called inside TChain::SetEntryList doesn't find any match between with the TChain 

Does the match happen via the file name?

vepadulano avatar Jul 30 '25 07:07 vepadulano

Hi, if I recall correctly, the problem was:

chain.Add("cernstaff.zip#cernstaff.root");

which later led to in TEntryList to:

filename = tree->GetTree()->GetCurrentFile()->GetName();
TUrl url(filename.Data(), true);

url copies the "hash part" as anchor as an internal variable of the class.

but then, we also call:

url.SetFile(filename);

where filename still contains the hash part.

so we ended up with

filename = url.GetUrl();

which appends the previous filename with the internal anchor, so we end up having two times the hash part.

so cernstaff.zip#filename.root#filename.root

Which means that then, the TEntryList does find the "filename-filename" file inside that zip container.

ferdymercury avatar Jul 30 '25 07:07 ferdymercury

revamping this nice PR.

dpiparo avatar Aug 24 '25 13:08 dpiparo

@vepadulano one Windows still failing but I guess it's unrelated.

ferdymercury avatar Oct 23 '25 09:10 ferdymercury