Simply use
hg lfconvert --to-normal <old> <new>
This will convert the repository in directory <old>
to a repository in directory <new>
with all large files turned back into normal files. Revision hashes will change, but otherwise, the revision history should remain intact.
If you actually want to first strip all large files from the repository and lose all information association associated with them (i.e. if your intent is to destroy the large files rather than keep them), first run:
hg convert --filemap <nolf> <old> <new>
where <nolf>
is the path to a file containing the single line:
exclude .hglf
and <old>
is the original repository and <new>
the target directory for the conversion.
This conversion will exclude the .hglf
directory, which contains all the "stand-in" files for large files. Note that such a conversion will also destroy all commits that only changed largefiles along with their commit messages (since they become empty commits).
You can also use hg convert
with an appropriate --filemap
after hg lfconvert --to-normal
to selectively delete only some large files.