Merge lp:~cjwatson/bzr-cia/server-side into lp:~jelmer/bzr-cia/main

Proposed by Colin Watson
Status: Rejected
Rejected by: Jelmer Vernooij
Proposed branch: lp:~cjwatson/bzr-cia/server-side
Merge into: lp:~jelmer/bzr-cia/main
Diff against target: 50 lines
1 file modified
__init__.py (+16/-3)
To merge this branch: bzr merge lp:~cjwatson/bzr-cia/server-side
Reviewer Review Type Date Requested Status
Jelmer Vernooij Needs Fixing
Review via email: mp+14057@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

This would be useful for installation on a bzr server, to save every developer from having to configure the CIA plugin separately.

lp:~cjwatson/bzr-cia/server-side updated
52. By Colin Watson

Show revision number in status output. Useful when submitting several revisions at once.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Thanks, merged!

Revision history for this message
Colin Watson (cjwatson) wrote :

On Thu, Oct 29, 2009 at 12:06:11AM -0000, Jelmer Vernooij wrote:
> Thanks, merged!

Thanks. I did just notice a problem with this. post-change-branch-tip is
triggered on 'bzr update' too, or 'bzr pull'ing changes from somebody
else ... any idea how we might solve this?

--
Colin Watson [<email address hidden>]

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On Thu, 2009-10-29 at 01:39 +0000, Colin Watson wrote:
> On Thu, Oct 29, 2009 at 12:06:11AM -0000, Jelmer Vernooij wrote:
> > Thanks, merged!
>
> Thanks. I did just notice a problem with this. post-change-branch-tip is
> triggered on 'bzr update' too, or 'bzr pull'ing changes from somebody
> else ... any idea how we might solve this?
Yeah, I noticed the same happens on "bzr branch" (I have bzr-cia
configured based on wildcards in ~/.bazaar/locations.conf) so I've
disabled this for now.

Perhaps you could register a 'post_push' hook in addition to a
'post_commit' hook?

Cheers,

Jelmer

--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This change makes the hook trigger on "bzr branch" and "bzr pull" as well.

review: Needs Fixing

Unmerged revisions

52. By Colin Watson

Show revision number in status output. Useful when submitting several revisions at once.

51. By Colin Watson

Use post_change_branch_tip hook if available rather than post_commit, since that allows us to notify on push.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '__init__.py'
2--- __init__.py 2009-05-04 22:01:43 +0000
3+++ __init__.py 2009-10-28 00:19:10 +0000
4@@ -43,6 +43,7 @@
5 from bzrlib.commands import Command, register_command
6 from bzrlib.option import Option
7 from bzrlib.trace import info, warning
8+from bzrlib.errors import UnknownHook
9
10
11 def branch_commit_hook(local, master, old_revno, old_revid,
12@@ -53,6 +54,13 @@
13 return cia_submit(local, new_revid, new_revno)
14
15
16+def post_change_branch_tip_hook(params):
17+ br = params.branch
18+ revs = br.revision_history()[params.old_revno:params.new_revno]
19+ for rev_id in revs:
20+ cia_submit(br, rev_id, br.revision_id_to_revno(rev_id))
21+
22+
23 class BacklogList:
24 def __init__(self, filename):
25 self.filename = filename
26@@ -176,7 +184,7 @@
27 msg = generate_cia_xml(branch, revid, project, revspec, author)
28
29 if not quiet:
30- info("Submitting revision to CIA.")
31+ info("Submitting revision %d to CIA." % revno)
32 if not dry_run:
33 try:
34 cia_deliver(cia_connect(config), msg)
35@@ -270,8 +278,13 @@
36 def install_hooks():
37 """Install CommitSender to send after commits with bzr >= 0.15 """
38 if getattr(Branch.hooks, 'install_named_hook', None):
39- Branch.hooks.install_named_hook('post_commit', branch_commit_hook,
40- 'CIA')
41+ try:
42+ Branch.hooks.install_named_hook('post_change_branch_tip',
43+ post_change_branch_tip_hook,
44+ 'CIA')
45+ except UnknownHook:
46+ Branch.hooks.install_named_hook('post_commit', branch_commit_hook,
47+ 'CIA')
48 else:
49 Branch.hooks.install_hook('post_commit', branch_commit_hook)
50 if getattr(Branch.hooks, 'name_hook', None):

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: