Comments on: simple twitter mercurial hook /anthony/2009/03/30/simple-twitter-mercurial-hook/ Just another Stolen Notebook weblog Sat, 07 Jan 2017 02:56:46 +0000 hourly 1 https://wordpress.org/?v=4.7.1 By: http://www. /anthony/2009/03/30/simple-twitter-mercurial-hook/comment-page-1/#comment-505 Tue, 23 Sep 2014 11:10:28 +0000 /anthony/?p=33#comment-505 Thanks for the marvelous posting! I certainly enjoyed reading it,
you happen to be a great author.I will remember to bookmark your blog
and definitely will come back down the road. I want to
encourage one to continue your great posts, have a nice day!

]]>
By: Tony's Blog › simple twitter oauth mercurial hook /anthony/2009/03/30/simple-twitter-mercurial-hook/comment-page-1/#comment-178 Fri, 24 Dec 2010 19:17:25 +0000 /anthony/?p=33#comment-178 […] older twitter mercurial hook relied on twitter’s basic authentication which, as of August 31, 2010, is no longer […]

]]>
By: Daniel Macedo /anthony/2009/03/30/simple-twitter-mercurial-hook/comment-page-1/#comment-102 Thu, 21 Jan 2010 01:34:05 +0000 /anthony/?p=33#comment-102 When you’re using:

incoming.notify = python:hgext.hgtwitter.hook

You should place the hgtwitter.py file in your site-packages/hgext/ folder (in $PYHTONPATH)

See how modules work here:
http://docs.python.org/tutorial/modules.html

Cheers,
~ Dani

]]>
By: Reza /anthony/2009/03/30/simple-twitter-mercurial-hook/comment-page-1/#comment-101 Fri, 11 Dec 2009 06:55:33 +0000 /anthony/?p=33#comment-101 Hello, I tried to incorporate your hgtwitter script on my mercurial server but failed to work.

Here’s what I did:
– I put hgtwitter.py in the same folder as mercurial (In my Ubuntu, it is in /usr/local/lib/python2.5/site-packages/hgext

– I added these lines in /etc/mercurial/hgrc (is it okay if I put it here, since I want it to update status on Twitter for all my repos)
[extensions]
hgext.hgrc=

[hooks]
incoming.notify = python:hgext.hgtwitter.hook

[twitter]
username = my_user_name (should it be a string?)
password = my_password (should this also be a string?)

But when I try to push changes to the server, I got:
abort: incoming.notify hook is invalid (import of “hgext.hgtwitter” failed)

It confuses me since in python shell, import hgext.hgtwitter seems to work.

Can you help me out?

Thanks.

]]>
By: Stodge /anthony/2009/03/30/simple-twitter-mercurial-hook/comment-page-1/#comment-88 Fri, 13 Nov 2009 13:09:35 +0000 /anthony/?p=33#comment-88 Where do you save this file? In ~/.hg?

Thanks

]]>
By: tonymagro /anthony/2009/03/30/simple-twitter-mercurial-hook/comment-page-1/#comment-39 Tue, 19 May 2009 11:57:13 +0000 /anthony/?p=33#comment-39 Sorry it’s taken me so long to respond. I finally got around to upgrading my mercurial to 1.2.1. The extension seems to be working and doesn’t produce any errors. One thing that I can think of that might cause this issue would be version 0.5 of python-twitter . The latest released version is 0.5 but I think it’s from around 2007 and it seems they have been working on it without an official release for 2 years. I use the latest svn version which contains some important bug fixes. You can find the latest svn version of python-twitter here http://code.google.com/p/python-twitter/source/checkout .

]]>
By: Charlie /anthony/2009/03/30/simple-twitter-mercurial-hook/comment-page-1/#comment-38 Sun, 26 Apr 2009 12:09:40 +0000 /anthony/?p=33#comment-38 Thanks! It’s working great now! I’m seeing one error when I do a push still, but it doesn’t seem to hurt anything (I get my tweets). However, I thought I’d send it along in case you had any ideas:

error: incoming.notify hook raised an exception: object is not callable

Anyway, thank you again for this great little hook. With that (and Trac), I’ve got everything I need!

]]>
By: tonymagro /anthony/2009/03/30/simple-twitter-mercurial-hook/comment-page-1/#comment-37 Sun, 26 Apr 2009 07:36:36 +0000 /anthony/?p=33#comment-37 I recall having a similar issue. I think the changeset_templater init function definition changed between mercurial 1.1 and 1.2. The 1.2 definition takes an extra ‘diffopts’ argument:
def __init__(self, ui, repo, patch, diffopts, mapfile, buffered):

while the 1.1 definition is missing the ‘diffopts’ argument:
def __init__(self, ui, repo, patch, mapfile, buffered):

Passing ‘diffopts=None’ as an argument to changeset_templater should solve the issue.

So the mercurial 1.2 version would look like:

t = cmdutil.changeset_templater(ui=ui, repo=repo,
                                   patch=False, diffopts=None,
                                   mapfile=None,  buffered=False)

While the mercurial 1.1 version would look like:
t = cmdutil.changeset_templater(ui=ui, repo=repo,
                                   patch=False, mapfile=None,
                                   buffered=False)

Thanks for letting me know. I think I will update the main article with the 1.2 version.

]]>
By: Charlie /anthony/2009/03/30/simple-twitter-mercurial-hook/comment-page-1/#comment-36 Sat, 25 Apr 2009 19:48:22 +0000 /anthony/?p=33#comment-36 Thanks for the script, it looks good, but I’m having a problem. I got the following message back:

error: incoming.notify hook raised an exception: __init__() takes exactly 7 non-keyword arguments (4 given)

I’m really not sure where the issue would be as I’m not given any trace (do you know how to get a trace?) and I don’t know how to debug without doing another commit (which is fine…). Anyway, I thought you might have some ideas?

My setup is as follows:

Python 2.4.4
Mercurial – 1.2.1
SimpleJSON 2.0.9
Python Twitter 0.5

Thanks for your help,
Charlie

]]>