Command server

Yuya Nishihara yuya at tcha.org
Sun Dec 18 05:10:57 CST 2011


Idan Kamara wrote:
> On Sun, Dec 18, 2011 at 8:38 AM, Sergey Antonov <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`

Hi, I had a similar problem which ends with 'abort: response expected'.
Maybe ui.getpass() won't work if the cmdserver process detached from
the console. It looks to interact with /dev/tty.

> > Output:
> > D:\Work\Tests1\SccTests3\**testcmdsrv>cmdsrv.py push
> > hello block: ('o', 'capabilities: getencoding runcommand\nencoding:
> > cp1251')
> > output: 'pushing to https://bitbucket.org/**zzsergant/testcmdsrv\n<https://bitbucket.org/zzsergant/testcmdsrv%5Cn>
> > '
> > output: 'searching for changes\n'
> > error: 'abort: http authorization required\n'
> > exit code: -1
> >
> > But when I run a hg.exe it asks for username/password:
> > D:\Work\Tests1\SccTests3\**testcmdsrv>hg push
> > pushing to https://bitbucket.org/**zzsergant/testcmdsrv<https://bitbucket.org/zzsergant/testcmdsrv>
> > searching for changes
> > http authorization required
> > realm: Bitbucket.org HTTP
> > user:
> >
> >
> >
> >>    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>`.


More information about the Mercurial mailing list