<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 2015-11-30 07:57, Chris Hecker
wrote:<br>
</div>
<blockquote cite="mid:565BF34A.5050502@d6.com" type="cite">
<div class="gmail_quote">On 2015-11-29 22:55, Joshua Judson Rosen
wrote:
<blockquote type="cite">
<br>
<div class="gmail_quote">On 11/29/2015 05:24 AM, Chris Hecker
wrote:
<blockquote type="cite">
<br>
<blockquote type="cite" style="color: #000000;">I was
expecting it to react on "bzr update" and "bzr commit".
<br>
However, it only seems to react on "bzr commit".
<br>
</blockquote>
<br>
Yeah, exactly, this is why I started the thread. <span
class="moz-smiley-s1" title=":)"><span>:)</span></span>
<br>
<br>
Thanks for looking into it...hopefully there's a hook we
can use?
<br>
</blockquote>
</div>
<br>
I think in order to catch updates to the <span
class="moz-txt-underscore"><span class="moz-txt-tag">_</span>working
tree<span class="moz-txt-tag">_</span></span>
<br>
that don't changes to the <span class="moz-txt-underscore"><span
class="moz-txt-tag">_</span>branch<span
class="moz-txt-tag">_</span></span> (as is the case for
"bzr update"),
<br>
you need to also establish a MutableTree hook--something like
this:
<br>
<br>
mutabletree.MutableTree.hooks.install_named_hook('post_transform',
<br>
update_revno_file,
<br>
'Update
"revno" file on working-tree update')
<br>
<br>
<br>
Note that you'll need to change your update_revno_file()
function
<br>
for that to work, because it'll be called with different
<br>
parameters than its currently expecting, but that's a starting
point.
<br>
<br>
Actually, you probably want to just use the various
MutableTree hooks
<br>
(MutableTree 'post_commit' + MutableTree 'post_transform'),
<br>
and <span class="moz-txt-underscore"><span
class="moz-txt-tag">_</span>not<span class="moz-txt-tag">_</span></span>
use the Branch hook. It looks like you're only interested
<br>
in catching changes to working trees--not to branches per se;
<br>
i.e.: you do not want to catch new revisions being
pushed/pulled
<br>
into a branch that <span class="moz-txt-underscore"><span
class="moz-txt-tag">_</span>doesn't<span
class="moz-txt-tag">_</span></span> have a working tree
<br>
(which the branch 'post_change_branch_tip' hook <span
class="moz-txt-underscore"><span class="moz-txt-tag">_</span>will<span
class="moz-txt-tag">_</span></span> catch).<br>
<br>
</blockquote>
</div>
<div class="moz-text-flowed" style="font-family: -moz-fixed;
font-size: 12px;" lang="x-unicode">
<br>
It looks like that's the one Sebastien tested that didn't work,
it hooked too early?
<br>
</div>
</blockquote>
Yes, "post_transform" is the hook I used in my other email (in this
thread, Nov 29).<br>
However, it seems you can't get the destination revision of "bzr
update" from this hook.<br>
<br>
</body>
</html>