cmdserver: set current process folder to a repository root after startup

Sergey Antonov sergant_ at mail.ru
Sun Feb 19 19:04:31 UTC 2012


On 17.02.2012 19:39, Matt Mackall wrote:
> On Fri, 2012-02-17 at 10:48 +0400, Sergey Antonov wrote:
>> When I run hg in cmdserver mode it treats the paths relative to the
>> process current folder (like standalone hg).
>>
>> So, if I get some path from a changeset description (i.e.
>> Folder/foobar.txt) the cmdserver does not accept it. I need either make
>> it a full path or relative to process current folder.
>
> Or add 'path:' to it. From 'hg help patterns':
>
>      To use a plain path name without any pattern matching, start it with
>      "path:". These path names must completely match starting at the current
>      repository root.
>

Well, for me this is not an option.

I'm writing a plugin to an IDE. There are too much existing code that 
operates on paths, written in assumption, that they are relative to 
repository root.

For me it is easier to run standalone mercurial once to know a 
repository root from a path and then start a cmdserver instance with 
that path as working directory, than adapt 'path:' pattern.

It is not a big deal though. Additional 100-200 ms per project in 
solution, if the project is not under known repository roots.

By the way, do you think that adding a option to a cmdserver to change a 
working directory to repository root after startup is a bad idea for 
some reason ? Actually, I think cmdserver should do this by default 
without any options.

-- 
Sergey Antonov
sergant_ at mail.ru



More information about the Mercurial-devel mailing list