On Sun, 2006-09-17 at 14:24 +0200, Lele Gaifax wrote:
I Ken, sorry for the delayed answer...

No problem.  Thanks for getting back to me.

I have just started looking at tailor.  This is also the first python program I've looked at,
so please excuse any mistakes I may be making due to my ignorance.


Ken Cavanaugh wrote:
> I am trying to use tailor to sync up changes from a mercurial repository
> to a CVS repository.
> I am using the following config file:
> --------------------------------------------
> [DEFAULT]
> verbose = True
> debug = True
> projects = CorbaToCVS
> 
> [CorbaToCVS]
> root-directory = /volumes/IDE/tailor
> subdir = work-area
> state-file = tailor.state
> source = hg:source
> target = cvs:target
> start-revision = INITIAL
> 
> [hg:source]
> repository = /volumes/ws/oss-work-new
> 
> [cvs:target]
> module = glassfish-corba
> repository = :pserver:[EMAIL PROTECTED]:/cvs
> -----------------------------------------------
> 
> The first operation that tailor attempts is:
> 
> 2006-09-14 18:22:34     INFO: $ cvs
> -d :pserver:[EMAIL PROTECTED]:/cvs co
> -d /volumes/IDE/tailor/work-area glassfish-corba
> 2006-09-14 18:22:36  WARNING: [Status 1]
> 
> This makes no sense, as the -d /volumes/IDE/tailor/work-area is wrong
> for CVS.

Why do you think is wrong? Tailor wants to checkout the repo in a 
particular directory, and that's the way to do it, isn't it?

I figured this one out.  The problem is that the second -d in the cvs checkout command
is a path instead of a single directory.  I think what really needs to happen here is:

cd /volumes/IDE/tailor
chvs -d :pserver:[EMAIL PROTECTED]:/cvs -d work-area glassfish-corba

and in fact there is code in Cvsps._checkoutUpstreamRevision to handle this.
But the code in Cvsps._prepareWorkingDir did NOT have the code, so I patched it as follows:

(ignore the first two changes; I was trying to debug things)

418a419
>           # self.log.info("basedir = %s", self.repository.basedir )
419a421
>           # self.log.info("parentdir = %s, subdir = %s", parentdir, subdir )
595c597
<         from os.path import join, exists
---
>         from os.path import join, exists, split
599a602
>       parentdir, subdir = split(self.repository.basedir)
601,602c604,605
<                                       "-d", self.repository.basedir)
<         cvsco = ExternalCommand(command=cmd)
---
>                                       "-d", subdir)
>         cvsco = ExternalCommand(cwd=parentdir, command=cmd)

This fixed my CVS checkout problem.

> tailor then proceeds to check out all of the mercurial files and
> construct a new Mercurial
> repository in the work-area directory.  

I think this is my other main problem.  I did not specify separate subdirs for cvs and hg
in the above config file, and so hg tried to work on top of the CVS files, and started complaining
immediately.  I've modified the config file to:

-----------------------------------------------------
[DEFAULT]
verbose = True
debug = True
projects = CorbaToCVS

[CorbaToCVS]
root-dir = /volumes/IDE/tailor
state-file = tailor.state
source = hg:source
target = cvs:target
start-revision = INITIAL

[hg:source]
subdir = hg
module = glassfish-corba
repository = /volumes/ws/oss-work-new

[cvs:target]
subdir = cvs
module = glassfish-corba
repository = :pserver:[EMAIL PROTECTED]:/cvs
------------------------------------------------------
As I'm writing this, things are proceeding, but I don't know what else I may
find.  One thing I can see is that I probably have problems with the .hgignore
file: I think tailor may have overwritten my .hgignore file with it's own.
I'll let you know what else I find after the operation completes and I have a
chance to look at the results.
At the end, tailor attempts to
> add all of the
> files to cvs using:
> 
> cvs -q add -ko <file name list>
> 
> which seems to be correct, but tailor has not checked for file
> differences (perhaps because the original co
> failed?).
Yes, this seems to be working now.
> 
> Also, there are no hg commands at all in the CorbaToCVS.log file, but
> work-area is a valid Mercurial
> repository, with a single changeset containing everything in the
> original Mercurial repository.

Assuming you meant "original CVS repository", that's the way tailor 
works. As for the "missing" hg commands in the log, that's because 
tailor uses the native mercurial library, and not the external command 
line interface. I agree that the hg backend could and should emit some 
noise about the actions it is executing.
OK, thanks, that would be helpful.

If you want the whole history, you should put "start-revision=INITIAL" 
in the configuration, since the default for that option is HEAD, that 
is, current "tip" of the source repository.
Yes, I think I have that now.

> 
> Any assistance you can offer would be greatly appreciated.

Hope this helps a little, see the wiki[*] for other info, and do not 
hesitate to ask about whatever is missing there :-)

ciao, lele.

[*] http://progetti.arstecnica.it/tailor/
_______________________________________________
Tailor mailing list
[email protected]
http://lists.zooko.com/mailman/listinfo/tailor

Reply via email to