Search code examples
jenkinsmercurialjenkins-pipelinepurge

Jenkins Terminal does not support executing hg purge


I am using jenkins, when executing Hg purge --all -R D:\path in jenkins pipeline it will return hg: unknown command 'purge'.

But when executing the same command in Windows Terminal it will execute correctly

Note : Jenkins in the same machine the Mercurial exist and purge plugin exist in the big repo and and sub repo

How to solve that issue ?


Solution

  • On the rights on delirium:

    • You may have more than one Mercurial on your host and Jenkins configured to use another instance (without extension), than command-prompt
    • You run Jenkins under different user and different mercurial.ini used, without extension (per-repository config can't be read)

    You can (select any method):

    • enable extension on system-wide basis (and disable it in repositories, there you don't want it)
    • replace extension by "old-style" mercurial alias
    • forcibly enable extension for single command hg purge --config extensions.purge=

    From my POV, system-wide extension in mercurial.ini will be most easy and logical solution