git filter-branch equivalent

Gregory Szorc gregory.szorc at gmail.com
Fri Apr 21 06:58:23 UTC 2017


On Thu, Apr 20, 2017 at 9:38 AM, Sean Farley <sean at farley.io> wrote:

> Uwe Brauer <oub at mat.ucm.es> writes:
>
> > Hi
> >
> > I hope this my last question concerning hg equivalents to git features,
> > but is there something comparable to git filter-branches?
>
> 'hg convert' is what you're looking for (e.g. branchmap, filemap, etc)
>

Yeah, convert is the closest Mercurial has. Although some aspects of
filter-branch can be accomplished via histedit, especially with the "exec"
action (which is provided by a 3rd party extension IIRC).

FWIW, git-filter-branch is just a shell script that iterates through
revisions and provides hook points ("filters") to perform actions at
various stages. If you know low-level Git commands, it isn't difficult to
roll your own specialized implementation. IMO its purpose is to give people
a common framework to code against for performing complex rewriting that
otherwise doesn't merit its own command. If Mercurial were to implement
similar functionality, it would almost certainly be a debug* command or an
extension.


>
> > Evolve, maybe?
>
> It's not really for this type of thing but you could try. Might be a
> good learning experience :-)
>
> _______________________________________________
> Mercurial mailing list
> Mercurial at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20170420/a4cc03b6/attachment-0002.html>


More information about the Mercurial mailing list