merge plug in

yota moteuchi yota.news at gmail.com
Tue Jun 21 18:08:46 UTC 2016


Hi,

I tried to write a custom merge plug-in for mercurial, but I have some
specific needs, and I don’t know how to proceed.

I work with Scade (by Esterel-Technologies/Ansys). This tool is a “boxes &
wires” based code editor/generator which have a complex, but file based,
storage format. In a nutshell :

   - An .etp file which lists all “equations” names, some libraries paths
   and a few project level metadata
   - Many .saofd files, each containing the “boxes & wires” (aka, the code)
   grouped in “equations”
   - As much .ann files, one for each .saofd, each containing annotations
   for the corresponding code


I already wrote a 3-way merge script in python for a full Scade project.
The user cannot interact with an usual text-based merge tool without
breaking the Scade file format, so I allowed only some limited choices (for
each “equation” pick one version among base, local or other) and all other
files (.ann and .etp) were modified automatically to keep the whole project
coherent.

Now, I would like to make it as a merge plug-in for mercurial, and be able
to use mercurial convenient push/pull/merge functionalities.

But mercurial merge plug-in mechanics are file based, I did not found a way
to change the order (.ann should be merged after .saofd choices, and .etp
at the end) nor skip or force merge on some specific files. Nor a way to
remember merge choices made in a previous file… (.ann merge depends on
choice made on .saofd)

Ideally I would be interested in doing a merge at the repository/directory
level, choosing what to merge manually, what to process automatically. But
I don't know how...

Thank you for reading :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial/attachments/20160621/c3a3f58b/attachment.html>


More information about the Mercurial mailing list