Erase existing duplicates in eshell-history-ring
Erase all existing duplicates instead of just the last duplicate entry
when 'eshell-hist-ignoredups' is set to 'erase'. Multiple duplicates
can exist in case 'eshell-hist-ignoredups' was set to something else
than 'erase' in the past or if the history file contains duplicates
(bug#71107).
* lisp/eshell/em-hist.el (eshell-add-input-to-history): Remove all
duplicates from history ring.
* test/lisp/eshell/em-hist-tests.el
(em-hist-test/add-to-history/erase-existing-dups): New test.
(cherry picked from commit
984fb346fdf0d5ec9eaea6126aad0bea8823b8a3)