mercurialhg-git

Why does hg gexport not work with the --cwd parameter?


Question title is pretty much the question. Here's a look at what I get:

enter image description here

I am trying to export a mercurial repository to git, but to a different directory. hg gexport works just fine without the --cwd parameter, but I don't want that -- I want to change the working directory to another one, but strangely, it says unknown command when I use that command line switch.

Any ideas?


Solution

    1. Real hgexport is not native hg command, it's part of hggit extension
    2. According to wiki, this part ("Using hg-git to interact with a hg repository with git") is outdated and may not reflect current state of extension
    3. >hg gexport --cwd $PATH work in my own tests without errors (so-so, see below) with command-line expanded accordingly to requirements

      hg gexport --cwd i:\Work\Personal!whyhq\ -R i:\Work\Personal!whyhq\site

    without -R gexport will not find source hg-repo after cdto target location

    1. And last, but not least: even properly used, hgexport in current hggit

      hg id

      15457fc67631 0.8.13

    do nothing (nothing changed on target). I suppose, for getting git-repo from hg you have to use trivial hg push <git-URL> today (yes, it work, with minimal tricks on your side: branch_bookmark_suffix = $STRING in .hgrc)

    Side note

    If you have hggit extension enabled (globally or per-repository) hg-repo is mirrored automagically into bare git-repo (at least it seems so) in .hg/git directory, you can just copy&rename it