Preupdate hook
Peter Kronenberg
pakronenberg at gmail.com
Tue Jul 19 00:06:06 UTC 2016
Not sure I follow. The graft doesn't exist yet. If I do a graft, then
internally, hg uses the merge logic and ends up calling the preupdate hook
on the merge. parent1 and parent2 have the 2 parent changesets, but there
doesn't' seem to be a way I can distinguish between a true merge and the
'dummy' merge being done for the grat
On Mon, Jul 18, 2016 at 7:15 PM, Jensen, Aaron <ajensen at webmd.net> wrote:
> Graft changesets have a source key in its extra information. You can check
> for the presence of it using the extras keyword in a template:
>
>
>
> > hg log -r REV --template '{get(extras,''source'')}\n'
>
>
>
> If a changeset was a graft, this will return the source changeset ID
> followed by a newline. If it doesn’t, it will return just a newline.
>
>
>
> More information on templating: https://www.selenic.com/hg/help/templates
>
>
>
>
>
>
>
> *From:* Mercurial [mailto:mercurial-bounces at mercurial-scm.org] *On Behalf
> Of *Peter Kronenberg
> *Sent:* Monday, July 18, 2016 3:31 PM
> *To:* mercurial at mercurial-scm.org
> *Subject:* Preupdate hook
>
>
>
> I've written a preupdate hook to disallow 'backward' merges. The problem
> I'm having is that it is also called for grafts and I don't want to
> disallow grafts. Is there a way I can tell in the hook which command
> initiated it?
>
> I also tried looking for the .hg/graftstate file, but that seems to be
> created only after the preupdate hook is called.
>
> Any help would be appreciated.
>
> thanks
>
> Peter
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20160718/be8fe70b/attachment-0002.html>
More information about the Mercurial
mailing list