If you use mercurial for your version control and you need to deploy continuously to a FTP site you should have a look at the extension developed by André Klitzing.
http://mercurial.selenic.com/wiki/FTPExtension
It will the first time upload all your files to your host and then only the missing committed changes, it’s really great instead or uploading all or remembering the 35 files that you changed everywhere you can simply do:
cd yourdirectory hg ftp yourseveralias --upload (Check the instructions for how to add your server alias,user,pwd)
Now unfortunately in my hosting the username MUST use @ like : user@site.com, so the URL is parsed wrongly by the python functions and the upload fails
I add this very naïve fix (New code in green and DON’T forget to add proper padding in your editor)
Around line 31: // Check if there's more than one @ if so replace the first one with some arbitrary characters that are hard to find in a username path = self.ui.config('paths', url) if path: if path.find('@') != path.rfind('@'): path = path.replace('@','{!!',1) self.url = urlparse.urlsplit(path) else: self.url = urlparse.urlsplit(url)Around line 144 on the _ftp function BEFORE the login function // Replace back the arbitrary characters '{!!' for the first @ if user: user = user.replace('{!!','@',1) ftp.login(user, psw)
Hope it helps someone else!
Advertisements
Using %40 (an urlencoded @) works, too
That sounds even better, thanks!
I think last time I was installing this extension i didn’t need to ‘fix’ as python parsed properly, but can’t remember clearly.