The converted CWE-ou repository is at https://bitbucket.org/cwalther/cwe-ou-nobink.
The converted H-uru/Plasma repository is at https://github.com/cwalther/Plasma-nobink.
The script that does the conversion is at https://gist.github.com/4246319.
- The three problematic Bink files [Edit: and their headers] are eliminated.
- A single common root for the OU fork and the H-uru fork is established, with committer name a'moaca' intact everywhere.
- The empty .hgignore file that was in the first few OU revisions is removed, to match the first revisions of H-uru. On the H-uru side (predominantly Git used) it would only be in the way and I would have to fabricate a commit that removes it at some point, and on the OU side (predominantly Mercurial used) it is useless as long as it is empty as well, the commit that introduces real ignore rules is now simply turned from a “modify” into an “add”.
- The corrupted merge commit that wouldn’t round-trip-convert successfully with Hg-Git is fixed.
- Empty commits that would convert differently with Hg-Git depending on the Mercurial version are eliminated.
- As a consequence, everything now round-trip-converts correctly with Hg-Git.
- The second “leg” on the H-uru fork and the bridge commits on top of it, introduced to establish a common ancestor between OU and H-uru, is eliminated as it is not necessary anymore.
- Git commits that move or rename files are annotated with rename information for Mercurial, to enable merges across them to succeed in Mercurial. This is particularly important for the move from MOULOpenSourceClientPlugin/Plasma20/Sources to Sources, where this purpose was previously served by the bridge commits now removed, but I figured it couldn’t hurt to do it in the few other cases too.
Note: In those other cases, the rename information is not always perfect:
- The fixed similarity threshold (75% is an experimentally found compromise) leads to some false positives as well as false negatives.
- To exactly emulate what Mercurial would do, the rename information of a merge should be exactly the sum of the rename informations from the second parent back to the common ancestor (what happens with respect to the first parent is exactly the total of what happened up to the second parent). This is not always the case here, because sometimes in the topic branches files are modified after being moved, making them more dissimilar or more similar and causing them to rise above or drop below the similarity threshold.
While this script could in theory be used by everyone to convert their repositories, it is a hassle because it requires you to have Mercurial, Git, Hg-Git, and backups of both CWE-ou and H-uru/Plasma. Therefore my next planned step is to try to write scripts that make that easier by pulling part of the solution from the published repositories rather than constructing everything from scratch.