SVN中结账和导出的区别
SVN结帐和SVN导出之间的确切区别是什么?
据我所知,导出不包括包含元数据的 .svn 目录,而签出则包括该 .svn 目录。 然而,我的同事最近遇到了这个问题,即从 SVN 存储库签出和导出的源编译的内容有不同的行为。 两者都编译正确,但是从 svn export 编译的可以工作,但是签出的根本不工作。
PS:正在编译的东西是嵌入式设备中使用的Linux 2.4内核。 图像编译并正确加载,但签出的图像不起作用。 它会在 insmod 期间导致内核恐慌。 为什么会发生这种事?
PPS:我们尝试了校验和和 diff 工具来检查从 SVN 导出和签出的两个目录之间的差异。 除了 .svn 目录之外,它们都是相同的。
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.
PS: The stuff being compiled is the 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 a kernel panic during insmod. Why could this happen at all?
PPS: We've tried checksumming and diff tool to check the difference between the two directories that are exported and checked out from SVN. Both of them are the same except for the .svn directory.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
svn export
只是从修订版中提取所有文件,并且不允许对其进行修订版控制。 它也不会在每个目录中散布 .svn 目录。svn checkout
允许您在创建的目录中使用版本控制,例如svn update
和svn commit
等标准命令。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 assvn update
andsvn commit
.正如您所说,签出包括 .svn 目录。 因此,它是一个工作副本,并且将具有正确的信息来进行提交(如果您有许可)。 如果您进行导出,您只是获取存储库当前状态的副本,并且无法提交回任何更改。
As you stated, a checkout includes the .svn directories. Thus it is a working copy and will have the proper information 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 repository and will not have any way to commit back any changes.
您是否重新运行结帐或导出到现有目录?
因为如果是的话,结帐将更新工作副本,包括删除任何文件。
但导出只会将所有文件从存储库传输到目标 - 如果目标是同一目录,这意味着存储库中删除的任何文件都不会被删除。
因此,您导出副本可能只能起作用,因为它依赖于存储库中已删除的文件?
Are you re-running your checkout or export into an existing directory?
Because if you are, checkout will update the working copy, including deleting any files.
But export will simply transfer all the files from the reporsitory to the destination - if the destination is the same directory, this means any files deleted in the repository will NOT be deleted.
So you export copy may only work because it is relying on a file which has been deleted in the repository?
构建过程是否有可能正在查看子目录并包含不应该包含的内容? 顺便说一句,您可以进行合法检查,然后删除 .svn 及其包含的所有内容。 这应该给你与出口相同的结果。 尝试在删除元数据之前和之后对其进行编译。
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.
(为了补充杰拉尔德的答案......)
另一个细微的区别是,尽管命令:
svn checkout ...repos_location/my_dir .
将
my_dir
中的文件放入当前目录(使用. svn
文件夹)在某些版本的 svn 中,命令:
svn export ...repos_location/my_dir .
将在当前目录中创建一个名为
my_dir
的文件夹然后将导出的文件放入其中。(To complement Gerald's answer...)
One further subtle difference is that, although the command:
svn checkout ...repos_location/my_dir .
puts the files in
my_dir
into the current directory (with the.svn
folder)in certain versions of the svn, the command:
svn export ...repos_location/my_dir .
will create a folder called
my_dir
in the current directory and then place the exported files inside it.如果您想上传(或提供给某人)项目,请使用导出。 如果您正在处理项目,请使用结帐。
Use export if you want to upload (or give to somebody) a project. If you are working with a project, use checkout.
额外的思考。 你说insmod崩溃了。 Insmod 加载模块。 这些模块是在构建内核的另一个编译操作中构建的。 内核和模块必须从相同的头文件等构建。 所有模块都是在内核构建期间构建的,还是“现有”的?
另一个想法,也是我知之甚少的,是 svn externals,它(如果使用)可以影响签出到项目中的内容。 导出时看看是否有什么不同。
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.
非常简单的区别,如果您只想查看项目的结构,则可以导出。
如果您想处理文件,那么您需要签出,因为它将包含 .svn 文件夹,其中包含制作工作副本的元数据,否则您会在导出时收到错误。
如果你执行
svn export
然后编辑一些文件然后提交,那么你会得到一个错误:Very simple difference, If you just want to see the structure of your project then go for export.
And if you want to work on your files then you need to checkout as it will include the .svn folder which contains the metadata which makes the working copy, else you get the error in export.
If you do
svn export
and then edit some files and then commit, then you will get an error:如果您使用 tortoise svn 客户端 - 在导出时 - 它显示 ..export / checkout ,这很令人困惑,它只是导出。 仅查看/读取使用导出,提交使用 - “结帐”
if you are using tortoise svn client - while exporting - it displays ..export / checkout , it is confusing , it is just export only. only view/read use export , to commit use - "checkout"