topic: fix some API to make it more robust
The new code can deal with changes in upstream mercurial.
--HG-- branch : stable
All legacy (hg-git based) Projects have been automatically migrated to native with the upgrade of 2025-01-23
The new code can deal with changes in upstream mercurial.
--HG-- branch : stable