Can bzr remember ftp-passwords?
John Arbash Meinel
john at arbash-meinel.com
Tue Apr 10 15:23:06 BST 2007
Martin Pool wrote:
> On 4/7/07, Chris Niekel <chris at niekel.net> wrote:
>> On Thu, Apr 05, 2007 at 06:02:45AM +1000, Martin Pool wrote:
>> > I don't think there is a way to do it at present. There is Python
>> > support for a netrc file, so we could use that to get it pretty
>> > easily, I would think.
>> It was indeed very easy. The hardest part was figuring out how to use
>> because I'm not used to it yet. Here's my patch, hopefully someone can
>> integrate it.
> Thanks Chris,
> Could you please try to write a test for it too to make sure it
> doesn't regress? In tests that subclass TestCaseInTempDir we set
> $HOME to a temporary directory. We also have the capability to run up
> an ftp server in testing, which is done in the code at the bottom of
> transport/ftp.py. I think you'll need to add a new
> blackbox/test_ftp.py, create a netrc file, run the server, then try to
It would be good to have a few test cases.
Also, if I read it closely, it seems you have to supply a username (and
then it matches based on username).
It might be nice to look up by host, and if there is only one username +
password, to just use it. That allows different people to use
"ftp://foo/bar" and have it Just Work, just like sftp urls.
I would even consider adding netrc processing for http urls.
I know at one point we added a spec for using "~/.authinfo":
I'm curious how '.authinfo' compares with .netrc. Does anyone know?
(If we decide to go this route, we could just say call the spec
implemented, using netrc instead of authinfo)
More information about the bazaar