Commit Graph

10 Commits

Author SHA1 Message Date
Idan Kamara
ce5a7b8382 cmdserver: repo.invalidate() on every runcommand
This will trigger the filecache and recreate every cached property that was
changed by something other than this cmdserver instance (e.g. by running
'hg commit' at the cmdline).
2011-07-25 22:19:28 +03:00
Idan Kamara
bab89cfab6 cmdserver: take repo.baseui as our ui
The ui passed to server() is really repo.ui, that is it contains its local
configuration as well.

When running commands that use a different repo than the servers cached repo,
we don't want to use that ui as the baseui for the new repo.
2011-07-14 11:46:15 +03:00
Idan Kamara
550bca7579 cmdserver: restore old working dir after dispatch when we have --cwd 2011-07-11 17:49:45 +03:00
Idan Kamara
b66cd482a9 cmdserver: assign repo.baseui before running commands
There are places in the code that use localrepository.baseui (see hg.remoteui),
we need the ui descriptors (and possibly other things) to be set
correctly on it, so output written to the remoteui descriptors ends up at the
right place.

Before this change, tests such as 'test-bookmarks-pushpull.t' didn't work.
2011-06-24 19:44:17 +03:00
Idan Kamara
29b1c451dc cmdserver: copy repo.ui before running commands 2011-06-24 19:43:59 +03:00
Idan Kamara
f916e19611 cmdserver: fix read-loop string concatenation 2011-06-24 16:36:24 +03:00
Idan Kamara
046eba79ef cmdserver: write the hello message as one chunk on the 'o' channel
This is a guaranteed by the protocol: clients know they need to read one chunk
off of the 'o' channel and treat that as the hello message.

They should ignore fields they don't recognize so they stay compatible with
new versions of the server in case we decide to add something.
2011-06-22 17:13:04 +03:00
Idan Kamara
29341e1294 cmdserver, runcommand: properly handle the client sending no arguments
No real reason for a client to do this, but still possible.

Previously if the client sent no arguments, a list with an empty string ['']
would be used as the arguments to dispatch, which would cause hg to complain
about an ambiguous command.

Instead, we simply check for no arguments and use an empty list instead (which
is equivalent to invoking hg with no args on the command line).
2011-06-21 15:38:10 +03:00
Idan Kamara
1d2537f10a cmdserver: don't raise EOFError when trying to read 0 bytes from the client 2011-06-21 15:13:39 +03:00
Idan Kamara
40027596a8 serve: add --cmdserver option to communicate with hg over a pipe 2011-06-03 17:27:41 +03:00