alter the commit message

Matt Mackall mpm at selenic.com
Fri Feb 3 18:30:01 UTC 2012


On Fri, 2012-02-03 at 09:47 -0600, Ken Ore wrote:
> Hello,
> 
> I hooked pretxncommit with a hook called precommit_hook.py.
> 
> I check the changed lines for any unix line endings, and interactively
> prompt the user if they want to continue or abort.
> 
> If the user aborts, I want to prepend OVERRIDE to their commit message.
> 
> The googles didn't have any helpful info, other than writing to
> .hg/commit.save.  I know how to get the
> commit message (via repo[repo[kwargs['node']].rev()].description()) but I
> don't know how
> to alter it.
> 
> Any ideas?  Impossible?  Thanks!

I don't understand what you're trying to do: if you abort the commit,
the commit message ceases to be relevant. There's nothing that forces
them to use the saved commit message from the aborted commit in the next
commit.


-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial mailing list