# # # add_file "contrib/netsync_display_branches.lua" # content [f3f80b5d575e8709b7d9e6d9503b7e48c1d2b12c] # # patch "ChangeLog" # from [33ca0c0f24f73988cc4ebb3683b906f6906c0701] # to [34c5b3175d5df3edad3e7c95616917fc5c56d63b] # ============================================================ --- contrib/netsync_display_branches.lua f3f80b5d575e8709b7d9e6d9503b7e48c1d2b12c +++ contrib/netsync_display_branches.lua f3f80b5d575e8709b7d9e6d9503b7e48c1d2b12c @@ -0,0 +1,36 @@ +-- Lua snippet to display what branches were affected by revisions and certs +-- that came into the database. I integrate it into my ~/.monotone/monotonerc +-- /Richard Levitte +-- +-- Released as public domain + +netsync_branches = {} +function note_netsync_start(nonce) + netsync_branches[nonce] = {} +end + +function note_netsync_revision_received(new_id,revision,certs,nonce) + for _, item in pairs(certs) + do + note_netsync_cert_received(new_id,item.key,item.name,item.value,nonce) + end +end + +function note_netsync_cert_received(rev_id,key,name,value,nonce) + if name == "branch" then + netsync_branches[nonce][value] = 1 + end +end + +function note_netsync_end(nonce) + local first = true + for item, _ in pairs(netsync_branches[nonce]) + do + if first then + io.stderr:write("Affected branches:\n") + first = false + end + io.stderr:write(" "..item.."\n") + end + netsync_branches[nonce] = nil +end ============================================================ --- ChangeLog 33ca0c0f24f73988cc4ebb3683b906f6906c0701 +++ ChangeLog 34c5b3175d5df3edad3e7c95616917fc5c56d63b @@ -1,3 +1,9 @@ +2006-10-25 Matt Johnston + + * contrib/netsync_display_branches.lua: Add Richard Levitte's + hook for displaying pulled branches. (see + http://lists.gnu.org/archive/html/monotone-devel/2006-04/msg00249.html ) + 2006-10-24 Nathaniel Smith * cmd_automate.cc (automate stdio): Do not run randomly through