Skip to content

Fix bug when link is pointing to pre-existing directory \#156

Spyros Argyropoulos requested to merge fixLinks into master

Description of bug

If a new DSID dir contained a link pointing to a pre-existing directory the commit script would copy it in the wrong way, creating a link pointing back to itself.

Changes introduced

When we encounter a link pointing to a pre-existing directory we don't do anything with it.

Tests

Below I have 3 directories: Screenshot_2022-02-19_at_18.55.02

the first one contains a link pointing to a pre-existing directory, the 3rd contains a link pointing to a new (unregistered) directory.

The expected behaviour would be

  • MadGraphControl_Py8G_2HDMa_4t_MadSpin.py -> ../../510xxx/510250/MadGraphControl_Py8G_2HDMa_4t_MadSpin.py
  • MadGraphControl_test.py -> ../NEWDIR/MadGraphControl_test.py

Before fix

Screenshot_2022-02-19_at_18.58.39

The bug: 511xxx/511336/MadGraphControl_Py8G_2HDMa_4t_MadSpin.py -> ../../511xxx/511336/MadGraphControl_Py8G_2HDMa_4t_MadSpin.py

After fix

Screenshot_2022-02-19_at_19.00.39

With the expected behaviour:

  • 511xxx/511336/MadGraphControl_Py8G_2HDMa_4t_MadSpin.py -> ../../510xxx/510250/MadGraphControl_Py8G_2HDMa_4t_MadSpin.py
  • 511xxx/511338/MadGraphControl_test.py -> ../../511xxx/511337/MadGraphControl_test.py

NB @cgutscho if !1588 (merged) is an exact copy of this script then this should also be fixed there

Issues resolved

Closes #156 (closed)

Merge request reports