SSHStore in bfile

David Douard david.douard at logilab.fr
Tue Nov 3 11:05:41 CST 2009


On Tuesday 03 November 2009 14:41:55 Greg Ward wrote:

[Greg]

> No, I didn't mean that bfiles is a candidate for inclusion in
> Mercurial.  (Maybe someday it will be, but that's a long way off.)  I
> was referring to the fact that every extension has to say "requires
> Mercurial version X or later".  In the case of bfiles, if X <= "1.3",
> then we have to put up with ugly duplication of ssh protocol-related
> code.  But if we get some refactoring patches into Mercurial in time
> for 1.4, and *then* make bfiles "require Mercurial 1.4 or later", we
> can drop the ugly duplication.

My mistake sorry. Ok I got it now. 


[Greg]
> What about adding a new server-side command, like bfserve?  Then
> instead of running
>
>   ssh <user>@<host> 'hg -R <storedir> serve --stdout'
>
> and requiring the 'bfstore' capability to use commands 'bfget' and
> 'bfput', we could instead run
>
>   ssh <user>@<host> 'hg bfserve <storedir>'
>
> and use commands 'bfget' and 'bfput'.  (I suppose it makes sense to
> use the capabilities mechanism anyways, but it is not strictly
> necessary.)

I did not think about this solution, and it is definitely the best one IMHO. 
I'll try to code this tomorrow evening.

> Next topic: testing.

[me]
> > In fact, current tests can (well,
> > should, since 'verify' is not yet implemented in SSHStore) run fine
> > against the SSHstore simply by changing the "store" parameter of the
> > hgrc. In my repo, I have modified a bit tests/common like:

[Greg]
> Not very useful IMHO: the current tests spend a lot of time testing
> bfadd, bfrefresh, bfstatus, etc... and all those commands have nothing
> to do with the store.  The only commands affected by a new store
> implementation are bfupdate and bfput.  So test-sshstore really only
> needs to use those commands (and bfstatus to make sure something
> happened).

You're right, my idea was a "quick, easy and dirty" solution. I'll write a 
specific test ASAP. 

[Greg]
> [re: the createrc() function in tests/common]
>
> > [bfiles]
> > store = ${STOREPROTOCOL}$STOREDIR
>
> That's a good idea.  Although I would just pass the store URL as a
> parameter to createrc.

Ok, I'll do this.


> [one last thing]
>
> > Another thing, do you mind if I also write, in common:
> >
> > createrc() {
> >    cat > $HGRCPATH << __EOF__
> > $USERHGRC
>
> [...]
>
> > This USERHGRC is useful for me when running sshstore tests to be able to
> > configure ui.remotecmd (which I need on my station, default hg being my
> > disctribution's one) using this shell variable.
>
> That should be unnecessary: why don't you just set $PATH so yours
> comes before /usr/bin/hg?

The pb is the hg command is executed in my ssh session, ni which my local PATH 
is lost. I could temporary modify my ~/.ssh/environment, but I prefer a 
solution based on command line arguments or shell variables (which the 
proposed solution allows).
>
> Greg



-- 
David Douard                        LOGILAB, Paris (France), +33 1 45 32 03 12
Formations Python, Numpy, Debian :  http://www.logilab.fr/formations
Développement logiciel sur mesure : http://www.logilab.fr/services
Informatique scientifique :         http://www.logilab.fr/science



More information about the Mercurial-devel mailing list