Partial port of r3099, in order to fix #3020 (which was similar to #2949). This fixes the TracBrowser ''Plain Text'' and ''Original Format'' links, which were broken in case an ancestor of the node got moved (the usual ''path/rev'' vs. ''created_path/created_rev'' issue).