<p dir="ltr">I'm not super comfortable aiming external tools into the .bzr directory...there must be a hook for what I want, no?</p>
<p dir="ltr">Chris<br>
</p>
<div class="gmail_quote">On Nov 29, 2015 8:21 PM, "Joshua Judson Rosen" <<a href="mailto:rozzin@hackerposse.com">rozzin@hackerposse.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 11/29/2015 05:06 AM, Sebastien Alaiwan wrote:<br>
> On 2015-11-29 09:56, Matthew D. Fuller wrote:<br>
>> On Sun, Nov 29, 2015 at 09:53:33AM +0100 I heard the voice of<br>
>> Sebastien Alaiwan, and lo! it spake thus:<br>
>>> Is this the expected behaviour? Not updating the "revno" file on<br>
>>> "bzr update -r XXX" commands seems error-prone, as you might want to<br>
>>> build older revisions of your project.<br>
>>><br>
>>> I was about to suggest to directly use, from your build system, the<br>
>>> ".bzr/branch/last-revision" file.  However, this will couple your<br>
>>> build system to bazaar ; which you probably want to avoid.<br>
>> Technically, you'd want to be directly using .bzr/checkout/dirstate,<br>
>> since you care about the WT rev, not the branch rev.<br>
>><br>
> Thanks for your suggestion. Then, I'd better go for the plugin approach than trying to parse 'dirstate' with a one-liner in a build system.<br>
<br>
Well, you don't necessarily have to *parse the dirstate* with the build-system. :)<br>
<br>
What I've done in Makefiles (with or without Automake) is to just<br>
have a rule like:<br>
<br>
        revno: $(wildcard .bzr/checkout/dirstate)<br>
                bzr revno --tree > $@<br>
<br>
<br>
That leaves the parsing to bzr, but avoids having to run bzr every time<br>
the Makefile is run.<br>
<br>
(I don't actually dump a "revno" file, but I do use a rule like that<br>
 to autogenerate my ChangeLog files for "make dist"; using<br>
 the "wildcard" function like that prevents make from barfing<br>
 on a `broken' rule-chain when .bzr/checkout/dirstate<br>
 doesn't exist--as is the case when someone has unpacked<br>
 a dist tarball--but still DTRT when bzr data is present).<br>
<br>
<br>
--<br>
"Don't be afraid to ask (λf.((λx.xx) (λr.f(rr))))."<br>
<br>
</blockquote></div>