[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Monotone-devel] mtn automate get_current_revision_id - bug or featu
From: |
Nuno Lucas |
Subject: |
Re: [Monotone-devel] mtn automate get_current_revision_id - bug or feature? |
Date: |
Thu, 20 Sep 2007 17:07:07 +0100 |
On 9/20/07, Thomas Moschny <address@hidden> wrote:
> On Thursday 20 September 2007, Richard Levitte wrote:
> > However, if that's good enough, you can use 'mtn list changed' and see
> > if it outputs any lines.
>
> You could check, whether the manifest has changed, i.e. whether these two
> outputs are the same:
>
> $ mtn automate get_base_revision_id | mtn automate get_revision
> address@hidden |
> grep new_manifest
>
> vs.
>
> $ mtn automate get_revision | grep new_manifest
>
> There might be other ways to achive the same.
I believe just checking for the "emptyness" of "mtn ls changes" can be
more optimal.
I use scons as the build system on this project, so I made this small
& dirty python "hack" to do the job (warning, python is not one of my
strongest points ;)
def mtn_revision( root_dir ):
rbase = commands.getoutput( "mtn automate get_base_revision_id" ).strip()
rcur = rbase
changes = commands.getoutput( "mtn ls changed" ).strip()
if len( changes ):
rcur = commands.getoutput( "mtn automate get_current_revision_id" )
return rbase, rcur.strip()
It seems to work ok, but I'm open for more optimal ideas, as this is
called on every build.
Regards,
~Nuno Lucas