convert and bfiles

View: New views
2 Messages — Rating Filter:   Alert me  

convert and bfiles

by David Douard-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am considering using Greg's new bfile extension for an existing project. For
this to be feasible, I need to convert an existing repo to make some of the
currectly hg-tracked files be now bfile-tracked ones.

I have hacked a bit mercurial's convert extension to do this. My hack allow to
use a new filemap command "bfile" like:

=8<-- filemap ---
bfile toto
bfile lib/toto
bfile tutu/tutu
==8<--

To use it, if one wants to autmatically perform fput operations during
conversion mecanism, he should specify a --config bfiles.store=XXX argument,
like:

david:~/tmp/test$ hg convert --config
bfiles.store=/home/david/tmp/test_convert_bfile/store/ -d hg --filemap
filemap src dst

I am not very happy with my hack, but it seems to work.

I attach the bundle of my modifications (from hg-stable repo). I'd appreciate
any comments and it may be useful to some users. My main concern is that I
did not see any way of doing this without modifying the convert extension
directly. Am I wrong?

David


--
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


_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

bfile_convert.bundle (2K) Download Attachment

Re: convert and bfiles

by Greg Ward-17 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Oct 27, 2009 at 12:05 PM, David Douard <david.douard@...> wrote:
> I am considering using Greg's new bfile extension for an existing project. For
> this to be feasible, I need to convert an existing repo to make some of the
> currectly hg-tracked files be now bfile-tracked ones.

Currently an open question.  Since I only care about converting from
CVS, I am concentrating on putting hooks into cvs2hg that let me
convert big files to "bfiles".  ('hg convert' from CVS is no good for
real-world CVS repositories.)

> I have hacked a bit mercurial's convert extension to do this. My hack allow to
> use a new filemap command "bfile" like:
>
> =8<-- filemap ---
> bfile toto
> bfile lib/toto
> bfile tutu/tutu
> ==8<--

Hmmm, interesting idea.  I'm doing something vaguely similar for my
cvs2hg conversion, but with regexes so I can easily grab a bunch of
files in one line.

> I am not very happy with my hack, but it seems to work.

Hey, that's the most important thing.  Obviously a patch to make
convert know about bfiles will never be accepted as long as bfiles is
not part of Mercurial.  So it probably should be the responsibility of
bfiles to modify convert to do ... something.

This is nowhere near the top of my priority list.  Ideas welcome,
patches even more welcome.

Greg
_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial