mercurialmercurial-convert

hg convert from git - produces hg folder only?


I am using hg convert to convert a Git repo into Mercurial on a Mac running macOS Mojave.

I've looked at similar questions How to use hg convert properly and hg convert not actually converting? but they haven't provided a definitive answer.

The command I've entered is:

hg convert ./my-src-dir/ my-dest-dir

The output is as follows:

initializing destination my-dest-dir repository
scanning source...
sorting...
converting...
6918 commit comment.
6917 commit comment.
6916 commit comment.
6915 commit comment.
6914 commit comment.
6913 commit comment.

This continues until the most recent commit...

1 commit comment.
0 commit comment.
updating bookmarks

I'm new to Mercurial. I can't see any errors but the destination directory only contains a .hg folder.

The output of hg sum is:

parent: -1:000000000000  (no revision checked out)
branch: default
commit: (clean)
update: 6919 new changesets (update)
phases: 6919 draft

Am I using this command correctly? I'm expecting to see all my src files in the new folder.


Solution

  • The key is:

    parent: -1:000000000000  (no revision checked out)
    

    The conversion presumably did work but you haven't yet updated your working folder to any particular changeset. So it appears to be empty.

    Not knowing what (if any) branches, bookmarks, etc. are in the repo I can't say exactly what you should update to. But let's say you just want the last revision in there, you could do:

    $ cd my-dest-dir
    $ hg up tip
    

    to get to whatever it thinks the last one is.