Command server

Sergey Antonov sergant_ at mail.ru
Sun Dec 18 05:50:05 CST 2011


On 18.12.2011 14:27, Idan Kamara wrote:
> On Sun, Dec 18, 2011 at 8:38 AM, Sergey Antonov <sergant_ at mail.ru
> <mailto:sergant_ at mail.ru>> wrote:
>
>     On 18.12.2011 1:45, Idan Kamara wrote:
>
>             I've made some tests and found that commands like
>             incoming/outgoing/push/pull does not asks for credentials via
>             command server protocol and simply aborts with 'abort: http
>             authorization required'.
>
>
>         Please provide an example (preferably with python-hglib). I
>         don't recall
>         trying it but I don't see why it shouldn't work.
>
>
>     Here are steps to reproduce:
>     1. hg clone https://bitbucket.org/__zzsergant/testcmdsrv
>     <https://bitbucket.org/zzsergant/testcmdsrv>
>     2. cd testcmdsrv
>     3. echo 2 >> a.txt
>     4. hg ci -m "edit"
>     5. Create cmdsrv.py and copy example client from part 5 at
>     http://mercurial.selenic.com/__wiki/CommandServer
>     <http://mercurial.selenic.com/wiki/CommandServer>
>     6. cmdsrv.py push
>
>
> I updated the example client, try `cmdsrv.py --config ui.interaction=1 push`
>

Thanks, now it works. This switch was not mentioned on the command 
server page, that is why I missed it.

But I have another problem.
If I run this script from console (cmd.exe) it works fine (asked for 
username/password).
But, if I run it from IDE (which redirects output to a tool window), 
then it hang after I enter username.

Looks like it asks for password in a different way, than for username.
Because username is echoed in the console, but password is not.
I don't understand how it asks for password.

Do you have any hints ?

Beside that, how can client (my GUI) know when mercurial asks for 
something, that can be echoed (username) and when not (password) ?
So, that I can hide password with '*'.

>             The second problem is that server needs a repository. I know
>         that
>             this is known limitation. But it is not possible to clone a
>         remote
>             repository in command server mode.
>
>
>         I tried fixing this at some point, but it had too many edge
>         cases to be
>         worth the hassle.
>
>         What we do in python-hglib is run clone (or other non-repo
>         commands) on
>         the command line and then optionally connect to it using the
>         cmdserver.
>
>
>     How do you connect to it ?
>     Using some command line switch to the command line client for clone
>     command ?
>
>
> No, we just do it in two separate commands, the first clones like usual
> on the cmdline: `hg clone foo <path>`,
> then start up the cmdserver on the new repo, `hg serve --cmdserver pipe
> -R <path>`.
>

Ok, I see.
I hoped that it would be possible to write a GUI only solution with 
command server.

-- 
Sergey Antonov
sergant_ at mail.ru


More information about the Mercurial mailing list