Converting a private repo to a public one

Isaac Jurado diptongo at gmail.com
Sun Feb 10 00:31:22 UTC 2013


Replying Michael Diamond:
> Hi all,
>
> I have a repository that contains private information (think passwords
> and the like) and I've since tidied it up so that nothing in the
> working directory is of concern, and I'd like to release it publicly.
> But the history contains private content.  I was hoping hg convert
> would enable me to remove those early revisions, but it seems like
> that's not possible.

Are you sure?

    hg help convert

    ...snip...

    Mercurial Source
    ################

    The Mercurial source recognizes the following configuration options, which
    you can set on the command line with "--config":

    convert.hg.ignoreerrors
                  ignore integrity errors when reading. Use it to fix
                  Mercurial repositories with missing revlogs, by converting
                  from and to Mercurial. Default is False.
    convert.hg.saverev
                  store original revision ID in changeset (forces target IDs
                  to change). It takes a boolean argument and defaults to
                  False.
    convert.hg.startrev
                  convert start revision and its descendants. It takes a hg
                  revision identifier and defaults to 0.

> Currently, I have:
>
> R1* > R2* > ...* > R10 > R11 > R12 > ...

Seems pretty straightforward:

    hg --config=convert.hg.startrev=R10 convert private_repo public_repo

Cheers.

-- 
Isaac Jurado

"The noblest pleasure is the joy of understanding."
                                  Leonardo da Vinci



More information about the Mercurial mailing list