Presenting a clean history: how to synchronize two repositories.

Michael McNeil Forbes michael.forbes at gmail.com
Tue May 13 19:10:08 UTC 2014


Hi Everyone,

Can anyone point me to some documentation or discussions about how I might
maintain a clean public repository in parallel with a messy development repo.

In particular, I would like to take an existing project and from it create a
cleaned up repo with only significant changes etc.

Motivation:

1) It is hard to learn about the history of the dirty project since there are
   thousands of revisions (especially for a student or new collaborator).  I
   would like a clean version of the repo as a pedagogical tool.  One possible
   option for this would be a way of "tagging" (not tags though) certain change
   sets so that that hg provides a simple overview of the repo via only those
   tagged changesets (collapsing the intermediate steps as needed, and showing
   only diffs between the tagged changesets etc.) I.e. some sort of metadata
   documenting the clean path through the repo but without actually editing
   history.
2) By mistake, we added too much to the repo.  I would like to strip out of
   bunch of stuff, and publish a cleaned version for the public at large to use
   (rather than just our core team which will probably stay working on the old
   repo with everything.

It seem in principle I could use hg convert to do this, but I am not sure about
maintaining links between the clean and dirty repo, and have not found very
much documentation about good strategies in this direction.  For example, I
would like to be able to maintain bi-directional patches between the two repos,
so that we can keep the core developers working in the messy dev repo, but
would like to be able to accept changes and PR's from the clean public repo.

Is there a good way of using convert and maintaining links between
corresponding change sets?

Any suggestions for good practises?

One strategy might be to create a new branch of pristine changesets in the dev
repo merging and cleaning up from the "tagged" revision, then ultimately
running hg convert to convert this pristine branch to make the public repo.  If
I do this, can I reconvert later and maintain the checksums of the public repo,
just adding new stuff?  That might work.

Less clear is how I could take new changes to the public repo, and incorporate
them back into the dev repo.

Any suggestions along these lines or for other strategies would be greatly
appreciated.

Thanks,
Michael.




More information about the Mercurial mailing list