Advertisement
Guest User

Untitled

a guest
Feb 21st, 2010
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.82 KB | None | 0 0
  1. # VCAnnounce Bazaar Script
  2. # Copyright (C) 2009 by Braden Walters
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, version 3 of the License.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program.  If not, see <http://www.gnu.org/licenses/>.
  15.  
  16.  
  17. import socket
  18. import struct
  19. from bzrlib import branch
  20. import config
  21.  
  22. def Post_Change_Branch_Tip (result):
  23.   #Connect to VCAnnounce plugin
  24.   #sock = socket.socket()
  25.  
  26.   #sock.connect ((config.botserver_host, config.botserver_port))
  27.   vars (result.branch.repository.get_revision (new_revno))
  28.  
  29.   revision_number = struct.pack ('i', result.branch.repository.get_revision(new_revno))
  30.   project_size = struct.pack ('i', len (result.branch.repository.get_revision(new_revid)))
  31.   project = result.branch
  32.   author_size = struct.pack ('i', len (result.branch.repository.get_revision(new_revid).authors))
  33.   author = result.branch.get_revision(new_revid).authors
  34.   commit_message_size = struct.pack ('i', len (result.branch.respository.get_revision(new_revid).message))
  35.   commit_message = result.branch.respository.get_revision(new_revid).message
  36.  
  37.   #sock.send (revision_number)
  38.   #sock.send (project_size)
  39.   #sock.send (project)
  40.   #sock.send (author_size)
  41.   #sock.send (author)
  42.   #sock.send (commit_message_size)
  43.   #sock.send (commit_message)
  44.  
  45. branch.Branch.hooks.install_named_hook ('post_change_branch_tip', Post_Change_Branch_Tip, 'Announce Commit')
  46. Post_Change_Branch_Tip()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement