I should tidy up my $HOME/bin directory, some of actually useful scripts and configurations were scattered here and there. Anyway, I’ve been using this one script when I work with shreds:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
Shreds source revisions is actually tracked on mercurial. But its integration testing and deployment hook is run under semaphoreci which only supports git. While exporting hg to git is easy, keeping the hash-chain consistent is apparently a bit tedious. I use git-hg which as its name implied is a reversed version of hg-git. It’s possible to re-import git commits back to mercurial. But it involves hg creating an entirely –disconnected– revision tree in the repo.
For example here is the commit we want to push back to mercurial, here is where the commit attached:
So we need to rebase from
-r 1496 to
Here’s after some rebase and strip:
I still wondering how should I wrote these steps into script like git-unhg above. Is it possible to detect detached tree in hg? Also have no idea how to find the correct changesets to rebase without tracing it manually