[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Monotone-devel] mtn automate get_current_revision_id - bug or featu
Re: [Monotone-devel] mtn automate get_current_revision_id - bug or feature?
Thu, 20 Sep 2007 15:42:42 +0200
Thunderbird 220.127.116.11 (X11/20070728)
Nuno Lucas schrieb:
> The problem is that if there are no changes to the working space,
> get_current_revision_id outputs some "bogus" ID, which have no value
> to me, as there are no changes.
> Is this a feature or a bug? Shouldn't the current_revision_id be equal
> to the base_revision_id if there are no changes? After all I can't
> commit an empty revision, so why the "bogus" id?
> What do you think?
Well, the current workspace revision (this is the one which is returned
by this command) is calculated from the hash of _MTN/revision. Since
this contains at least a dummy manifest id
(0000000000000000000000000000000000000002) and the old_revision stanza
(which is the base revision of the workspace), the result of this
process is rather unpredictable.
You will, btw, never be able to say "my workspace has no additional
changes" just by comparing base revision and current revision, just
because you run into a chicken-egg problem here: If the base revision id
should be equal to the current revision id, then the current revision's
text has to incorporate the same changes like the base revision's text,
and this is impossible, because of the chained old_revision stanza in there.
So, the only way (currently) to determine if the current workspace has
changes or not, is to look at the output of mtn au get_revision. If this
contains a dummy new_manifest stanza, then you're good to go.
If this is a more requested feature, one could think about incorporating
this check into a separate command, which acts line-based and is easier
to handle for command-line scripts.
only dead fish swim with the stream: http://thomaskeller.biz/blog
Am Anfang war das Wort: http://www.schäuble-muss-weg.de