[PATCH] Re: anyone using push builtin?
Matthieu Moy
Matthieu.Moy at imag.fr
Fri Nov 25 13:15:56 GMT 2005
Jan Nieuwenhuizen <janneke at gnu.org> writes:
> http://bazaar.canonical.com/IntroductionToBzr
>
> says
>
> bzr push LOCALBRANCH sftp://servername.com/this/directory/here
>
> is LOCALBRANCH a typo?
Seems it is (bzr push -h confirms). Fixed on the wiki.
> $ bzr push lilypond.org:~janneke/public_html/bzr/gub
> bzr: ERROR: bzrlib.errors.BzrCommandError: Parent directory of lilypond.org:~janneke/public_html/bzr/gub does not exist.
> at /home/janneke/bzr/bzr/bzrlib/builtins.py line 461
> in run
> [3]13:18:01 janneke at peder:~/bzr/gub
I think you have to create ~janneke/public_html/bzr/ manually before.
Perhaps bzr should do it automatically.
> $ bzr push sftp://lilypond.org:~janneke/public_html/bzr/gub
> bzr: ERROR: exceptions.ValueError: invalid literal for int(): ~janneke
> at /home/janneke/bzr/bzr/bzrlib/transport/sftp.py line 465
> in _parse_url
The error message should have been clearer and say "~janneke: Invalid
port number".
The patch should look like this
--- bzrlib/transport/sftp.py
+++ bzrlib/transport/sftp.py
@@ -510,7 +510,10 @@
if self._port is None:
self._port = 22
else:
- self._port = int(self._port[1:])
+ try:
+ self._port = int(self._port[1:])
+ except exception.ValueError:
+ raise SFTPTransportError('%s: invalid port number' % self._port[1:])
if (self._path is None) or (self._path == ''):
self._path = ''
else:
but I haven't got paramiko installed on my machine right now, so I
can't test it.
> [3]13:18:33 janneke at peder:~/bzr/gub
> $ bzr push sftp://lilypond.org/~janneke/public_html/bzr/gub
> bzr: ERROR: bzrlib.errors.NonRelativePath: path u'sftp://lilypond.org/~janneke/public_html/bzr/gub' is not under base URL u'sftp://janneke@lilypond.org/%7Ejanneke/public_html/bzr'
> at /home/janneke/bzr/bzr/bzrlib/transport/sftp.py line 199
> in relpath
This one is fixed in John's branch. In the meantime, you can provide
your username explicitely in the URL.
> bzr: ERROR: Channel request for unknown channel 1
> bzr: ERROR: Channel request for unknown channel 1
These come from incorrect destructors in paramiko IIRC, but they're
harmless.
Try
$ bzr push sftp://janneke@lilypond.org/home/janneke/public_html/bzr/gub
--
Matthieu
More information about the bazaar
mailing list