monotone

Issue 146: mtn_automate cannot be called from hooks (specifically validate_change)

Reported by Judson Lester, Feb 19, 2011

Steps to reproduce the problem:
-------------------------------

I'm trying to use validate_change to refuse a commit if there are 
files that are unknown - I have a hard time with commits that are 
broken because they don't include new files needed to run.  So:

1. Write a validate_change hook that includes: 
 local bool, str = mtn_automate("inventory")
 print(str)
2. mtn commit

Expected result:
----------------
Around the commit, there should be output of the contents of the 
workspace

Actual results:
---------------
mtn: lua: misuse: It is illegal to call the mtn_automate() lua 
extension,
mtn: lua: misuse: unless from a command function defined by 
register_command().


Output of `mtn version --full`:
-------------------------------

Comment 1 by Thomas Keller, Feb 19, 2011

Some discussion on this topic including common pitfalls:

http://colabti.org/irclogger/irclogger_log/monotone?date=2011-02-18#l
125

(also skip to the next day)

Related issues 139, 132, 112, 82, 81, and 75 (hover over the links 
to get a description).

Created: 13 years 2 months ago by Judson Lester

Updated: 13 years 2 months ago

Status: New

Followed by: 1 person

Labels:
Type:Defect
Priority:Medium

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status