monotone-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-users] include the monotone revision ID on the build process


From: Mathias Weidner
Subject: [Monotone-users] include the monotone revision ID on the build process
Date: Wed, 10 Aug 2011 09:50:48 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11

Hello,

this is my attempt on a theme that I found in a message in the
monotone-devel list.
<http://www.mail-archive.com/address@hidden/msg09311.html>

I started with the python code in
<http://www.mail-archive.com/address@hidden/msg09319.html>
and ported it to Lua.

I added a date, since anyone who only sees the end-product and doesn't
have the revision tree at hand would not get much meaning out of the id.
First I only used os.date() but later decided it would make more sense
to take the date from the certs if the base revision is not altered.

The next step was to rewrite this to run it as a user-defined monotone
command. After all, there is a Lua interpreter in monotone so why not
use this, since I already deal with monotone.

So here is the code, open for comments. I do use this in the Makefile
for my entry level book on monotone (in German) like this:

revision.txt: $(REVISIONDEPENDENCIES)
        mtn --rcfile revision.lua revision > .revision.txt
        mv .revision.txt revision.txt

The output of the script tells you three things about the revision:
- the id of the base revision
- the id of the current revision (the base revision, if unaltered)
- either the day, when the base revision was committed, or the current
  day, if the base revision was altered and not committed

You probably want to generate another output format if you use it.
Just change the lines with say(...).

Regards,

Mathias Weidner

Attachment: revision.lua
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]