SVN中结账和导出的区别

发布于 2024-07-11 03:05:43 字数 359 浏览 10 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

£冰雨忧蓝° 2024-07-18 03:05:43

svn export 只是从修订版中提取所有文件,并且不允许对其进行修订版控制。 它也不会在每个目录中散布 .svn 目录。

svn checkout 允许您在创建的目录中使用版本控制,例如 svn updatesvn 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 as svn update and svn commit.

暖风昔人 2024-07-18 03:05:43

正如您所说,签出包括 .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.

小伙你站住 2024-07-18 03:05:43

您是否重新运行结帐或导出到现有目录?

因为如果是的话,结帐将更新工作副本,包括删除任何文件。

但导出只会将所有文件从存储库传输到目标 - 如果目标是同一目录,这意味着存储库中删除的任何文件都不会被删除。

因此,您导出副本可能只能起作用,因为它依赖于存储库中已删除的文件?

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?

小姐丶请自重 2024-07-18 03:05:43

构建过程是否有可能正在查看子目录并包含不应该包含的内容? 顺便说一句,您可以进行合法检查,然后删除 .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.

っ〆星空下的拥抱 2024-07-18 03:05:43

(为了补充杰拉尔德的答案......)
另一个细微的区别是,尽管命令:

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.

伴我老 2024-07-18 03:05:43

如果您想上传(或提供给某人)项目,请使用导出。 如果您正在处理项目,请使用结帐。

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

掀纱窥君容 2024-07-18 03:05:43

额外的思考。 你说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.

萌梦深 2024-07-18 03:05:43

非常简单的区别,如果您只想查看项目的结构,则可以导出。

如果您想处理文件,那么您需要签出,因为它将包含 .svn 文件夹,其中包含制作工作副本的元数据,否则您会在导出时收到错误。

如果你执行svn export然后编辑一些文件然后提交,那么你会得到一个错误:

../../xxx 不是您的工作副本。

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:

../../xxx is not your working copy.

如若梦似彩虹 2024-07-18 03:05:43

如果您使用 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"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文