Ticket #54 (new defect)

Opened 1 year ago

Last modified 7 months ago

mangled CVS checkouts because of -d and no -N

Reported by: long.in.the.tooth Assigned to: warner
Priority: minor Milestone: 0.8.0
Component: vc-support Version: 0.7.5
Keywords: CVS Cc:

Description

As per an earlier email back in May: (I finally got corporate permission to release code to buildbot...)

If one has a directory tree such as: foo/bar/baz/baz.py

with no files in foo or foo/bar save CVS, then a '-d' checkout will place baz.py in the directory specified after -d. Eliminating the tree structure. This is CVS being helpful, and not necessarily a bad thing.

However for build purposes it probably is a bad thing, since in general, I would think you'd want a faithful representation of the repository. Happily, the fix is trivial:

Index: buildbot/slave/commands.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v
retrieving revision 1.83
diff -r1.83 commands.py
1425c1425
<                    [verb, '-d', self.srcdir])
---
>                    [verb, '-N', '-d', self.srcdir])

In slave.commands.py

Change History

08/12/07 00:12:28 changed by warner

  • summary changed from mangled CVS checkouts because of -d and on -N to mangled CVS checkouts because of -d and no -N.

10/01/07 13:03:45 changed by warner

  • milestone set to 0.7.7.

03/17/08 15:50:20 changed by warner

It doesn't truncate the whole tree, does it? Some quick experiments here (with cvs-1.12.13 on debian/sid) suggest that it only removes the top-level 'foo' directory, which is (I think) what we usually want.

Here's what I did:

setup:

79:warner@monolith% cvs -d /tmp/test123 init
80:warner@monolith% cvs -d /tmp/test123 co -d setup .
cvs checkout: Updating setup
cvs checkout: Updating setup/CVSROOT
U setup/CVSROOT/checkoutlist
U setup/CVSROOT/commitinfo
U setup/CVSROOT/config
U setup/CVSROOT/cvswrappers
U setup/CVSROOT/loginfo
U setup/CVSROOT/modules
U setup/CVSROOT/notify
U setup/CVSROOT/postadmin
U setup/CVSROOT/postproxy
U setup/CVSROOT/posttag
U setup/CVSROOT/postwatch
U setup/CVSROOT/preproxy
U setup/CVSROOT/rcsinfo
U setup/CVSROOT/taginfo
U setup/CVSROOT/verifymsg
81:warner@monolith% cd setup
82:warner@monolith% mkdir -p foo/bar/baz
83:warner@monolith% echo "hiya" >foo/bar/baz/baz.py
84:warner@monolith% cvs add foo
Directory /tmp/test123/foo added to the repository
85:warner@monolith% cvs add foo/bar
Directory /tmp/test123/foo/bar added to the repository
86:warner@monolith% cvs add foo/bar/baz
Directory /tmp/test123/foo/bar/baz added to the repository
87:warner@monolith% cvs add foo/bar/baz/baz.py 
cvs add: scheduling file `foo/bar/baz/baz.py' for addition
cvs add: use `cvs commit' to add this file permanently
88:warner@monolith% cvs commit -m "added" .
cvs commit: Examining .
cvs commit: Examining CVSROOT
cvs commit: Examining foo
cvs commit: Examining foo/bar
cvs commit: Examining foo/bar/baz
/tmp/test123/foo/bar/baz/baz.py,v  <--  foo/bar/baz/baz.py
initial revision: 1.1
%

checkout with just '-d':

89:warner@monolith% cd ..
90:warner@monolith% cvs -d /tmp/test123 co -d source foo
cvs checkout: Updating source
cvs checkout: Updating source/bar
cvs checkout: Updating source/bar/baz
U source/bar/baz/baz.py
91:warner@monolith% ls source/bar/baz/baz.py 
source/bar/baz/baz.py

checkout with '-N' and '-d':

94:warner@monolith% cvs -d /tmp/test123 co -N -d sourceN foo
cvs checkout: Updating sourceN/foo
cvs checkout: Updating sourceN/foo/bar
cvs checkout: Updating sourceN/foo/bar/baz
U sourceN/foo/bar/baz/baz.py
95:warner@monolith% ls sourceN/foo/bar/baz/baz.py 
sourceN/foo/bar/baz/baz.py

So it seems like it's not discarding the 'bar' as your note suggests. Using -N makes it retain the module name that you're checking out (the 'foo'), which might be what you want or it might not. Buildstep authors need to know which it's going to be.. the normal ShellCommand will be run from the 'source' (or rather the corresponding 'build') directory, but if we add -N then suddenly their code will be one directory down from there.

What version of CVS did you observe this problem with? Maybe the behavior changed at some point.

03/22/08 18:04:07 changed by warner

  • milestone changed from 0.7.7 to 0.7.8.

I'm going to need more information about this one to make a code change, since adding -N changes the location of the checked-out tree and would require a lot of changes to step workdirs. Pushing it out to 0.7.8 .

05/02/08 16:30:45 changed by warner

  • milestone changed from 0.7.8 to 0.7.9.

still need more information.. pushing out to 0.7.9