# # # add_dir "examples" # # add_file "examples/000README.txt" # content [f98de5c62e21d7bb33c49a435476ccb7462cd970] # # add_file "examples/display_branches.lua" # content [f3f80b5d575e8709b7d9e6d9503b7e48c1d2b12c] # # patch "ChangeLog" # from [1b822ac9ae7cbdf1ff93f599450e5186add032bc] # to [5531476bc01ea278f1c1f016d109577fb0f40a98] # # patch "debian/changelog" # from [a3f4ddb644b8e0c6d514f7ae4d75a5a858d857b9] # to [de96322a6bbc5ea570c102a062062e22b5af4dd7] # # patch "debian/docs" # from [2d3662c90d12b7c5fb629bf5b29043bc077755bf] # to [264ca3ecb7080cab65203bc13a893ccdd3f0df6e] # ============================================================ --- examples/000README.txt f98de5c62e21d7bb33c49a435476ccb7462cd970 +++ examples/000README.txt f98de5c62e21d7bb33c49a435476ccb7462cd970 @@ -0,0 +1,5 @@ +Examples directory + +A directory with small examples of what you can do with monotone. +Could be some nice trick or a cool set of lua hooks to add to your +~/.monotone/monotonerc, or... ============================================================ --- examples/display_branches.lua f3f80b5d575e8709b7d9e6d9503b7e48c1d2b12c +++ examples/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 1b822ac9ae7cbdf1ff93f599450e5186add032bc +++ ChangeLog 5531476bc01ea278f1c1f016d109577fb0f40a98 @@ -1,3 +1,14 @@ +2006-04-25 Richard Levitte + + * examples/000README.txt, examples/display_branches.lua: Start a + directory of small examples and other cool things you can do with + monotone. Contrary to the contrib directory, these files can + seldom be taken and used as they are, they usually need to get + integrated into some other file. + * debian/docs, debian/changelog: Make sure the examples directory + end up inside Debian's standard documentation directory, and + document this change. + 2006-04-24 Derek Scherger * contrib/monotone.el (monotone-commit-complete): call line ============================================================ --- debian/changelog a3f4ddb644b8e0c6d514f7ae4d75a5a858d857b9 +++ debian/changelog de96322a6bbc5ea570c102a062062e22b5af4dd7 @@ -1,3 +1,9 @@ +monotone (0.26.0-0.2) unstable; urgency=low + + * Added examples to the files that should end up in the documentation. + + -- Richard Levitte Tue, 25 Apr 2006 11:30:05 +0200 + monotone (0.26.0-0.1) unstable; urgency=low * New upstream release. (NB: The official upstream version number ============================================================ --- debian/docs 2d3662c90d12b7c5fb629bf5b29043bc077755bf +++ debian/docs 264ca3ecb7080cab65203bc13a893ccdd3f0df6e @@ -10,3 +10,4 @@ contrib debian/README.Debian debian/TODO.Debian +examples