This is possible locally, but not globally, and it changes the identifier of each commit after the point at which the file was added. For the changes to take effect, you will need access to each copy of the repository, especially those that are popped or popped out.
However, I followed the Edit History described on the Mercurial wiki to remove the file from one of my repositories. In this sequence, it is assumed that in the 1301: 5200a5a10d8b edition, the path/to/badfile.cfg file is added, which was not changed in any subsequent revision:
Include the MQ extension in .hgrc :
[extensions] mq =
Check out the latest changes from the upstream.
hg pull
Import all of the add file into MQ:
hg qimport -r 1301:tip hg qpop -a
Remove the file from the command that added it.
hg qpush 1301.diff hg forget path/to/badfile.cfg hg qrefresh
Convert fixes to newer versions of Mercurial.
hg qpush -a hg qfinish -a
Click new versions up.
hg push -f
In the upstream repository and each individual copy, delete the old versions.
hg strip 5200a5a10d8b
Warning This step can ruin the work if you are not careful. If someone has done something since the last time you pulled out of the upstream, you will have to reinstall this work before removing. Unfortunately, the rebase extension rebase not useful here; you will have to use MQ again, converting the new commits into the patches that you apply for the new tip.
Good luck.
eswald Nov 22 2018-11-11T00: 00Z
source share