views:

5977

answers:

5

What is the exact difference between SVN checkout and SVN export?

From what I know, export does not include the .svn directory which include metadata, and checkout included that .svn directory. Yet, my colleague had this problem recently that there is a different behaviour for the stuff compiled from sources that is checkout and exported from SVN repo. Both of them compiled correctly, but the one compiled from svn export works, but the one that is checked out doesn't work at all.

p.s.: the stuff being compiled is linux 2.4 kernel that is being used in an embedded device, the image compiles and load correctly, but the checked out one doesn't work, it causes kernel panic during insmod. Any idea on why could this happen at all?

p.p.s.: we've tried checksumming and diff tool to check the difference between the two directory that is exported and checked out from SVN, both of them are the same except for .svn directory. It's driving both of us crazy for quite a few days!!

+4  A: 

As you stated a checkout includes the .svn dirs thus it is a working copy and will have the proper info to make commits back (if you have permission). If you do an export you are just taking a copy of the current state of the repo and will not have any way to commit back any changes.

Is there any reason to have a working copy (ie .svn ) if you are just building?

notbenh
+10  A: 

svn export simply extracts all the files from a revision and does not allow revision control on it. It also does not litter each directory with .svn directories.

svn checkout allows you to use version control in the directory made, e.g. your standard commands such as svn update and svn commit.

Gerald Kaszuba
Note that this really isn't what he needs to know.
gbarry
A: 

Use export if you want upload (or give to somebody) project. If you working with project, use checkout.

Pawka
+4  A: 

Any chance the build process is looking into the subdirectories and including something it shouldn't? BTW, you can do a legal checkout, then remove the .svn and all it contains. That should give you the same as an export. Try compiling that, before and after removing the metadata, as it were.

gbarry
We've tried this before, it's not working for us, it's really frustrating for both of us.
andycjw
Are you comparing a fresh checkout to an export or a repository that was once checked out and updated to an export? If the latter, you might have some cruft lying around that gets pulled into the build.
Wait...! What does "not working" mean? That the build works and so the experiment fails, or the build fails and thus proves that the metadata is what confuses it?
gbarry
'not working' here meant with the legal checkout and stripped of .svn using 'find . -name .svn | xargs rm -rf', the build doesn't work exactly like export, when it should be, since like everyone knows, export is just checkout without the .svn metadata for version control
andycjw
So, now, if you were to remove *parts* of .svn (or maybe just having an empty .svn) you can "divide and conquer" and ultimately discover just what is causing it to fail. Given infinite time, anyway. Have you diff'ed the two kernel images? (and the module images?)
gbarry
A: 

Additional musings. You said insmod crashes. Insmod loads modules. The modules are built in another compile operation from building the kernel. Kernel and modules have to be built from the same headers and so forth. Are all the modules built during the kernel build, or are they "existing"?

The other idea, and something I know little about, is svn externals, which (if used) can affect what is checked out to your project. Look and see if this is any different when exporting.

gbarry