SVN:发布分支和外部? [英] SVN: Release branch and externals?

查看:108
本文介绍了SVN:发布分支和外部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有两个网站用于同一客户(主要www网站,另一个用于电子商务网站,该网站位于单独的服务器上),它们使用共享的代码部分(各种功能/样式/ javascript等)。当前,我们通过在SVN中将共享代码作为单独的项目(在同一存储库中)并使用svn:externals将它们各自的分支拉入两个网站项目中来进行管理。

We have two websites for the same client (main www site and another for the ecommerce site which sits on a seperate server) that use shared portion of code (various features/styles/javascript etc.). We currently manage this by having the shared code as seperate projects (in the same repos) in SVN and using svn:externals to pull the branch of each of these into the two website projects.

我们刚刚创建了两个发行分支,两个站点各一个。在正常工作时,当准备上线时,所有内容都会集中到每个站点的主干中,我们将其合并到该站点的发行分支中。可以使用,但是今天我们修改了一些共享代码,并注意到当我们在release分支上进行更新时,release分支立即将其拉出。这不是我们想要的:(

We have just created two release branches, one each for the two sites. Everything gets commited to trunk for each of the sites as normal when working and when "ready for live" we merge it into the release branch for that site. Works a treat except today we modified the some of the shared code and noticed that the release branch pulled it in straight away when we did an update on the release branch. This is not what we wanted :(

因此,有任何想法可以解决这个问题。我们使用外部函数来干燥代码共享,但是还有另一种方法?请注意,在此问题中(我该如何在SVN中分支,并使其也分支我的svn:external文件夹?)他们提到外部是不好的,我们应该使用不同的构建过程,但没有提及应该是什么。

So any ideas how we can iron out this problem. We used externals to DRY up the sharing of the code but is there another way? Notice that in this question (How can I branch in SVN and have it branch my svn:external folders as well?) they mention externals are bad and we should be using a different build process but no mention of what that should be.

我们有CruiseControl.net运行我们的构建,并且渴望解决这个难题。有人对更好的流程有任何想法吗?

We have CruiseControl.net running our builds and are keen to get this nut cracked. Has anyone any ideas on a better process?

欢呼

Pete

更新:从那以后,我们开始使用Mercurial( Fogcreek's Kiln)是我们的源代码控制。Mercurial也有子仓库的想法,因此我们在该项目中也遵循了这条路线,但是这样做要付出一定的代价,因为很难对分支进行标记。 d只是使所有内容保持最新。我们最新的方法是将两个项目都放入一个仓库中,包括所有共享仓库。这给了我们一个大型项目,它减慢了克隆时间(在SVN中签出),但是我们这样做的很少,以至于不必处理子存储库而获得的收益值得一去。现在,我们使用功能切换/切换而不是分支,这也大大简化了我们的开发。

UPDATE: We've since moved to using Mercurial (Fogcreek's Kiln) for our source control. Mercurial also has the idea of sub-repos so we followed that route with our project there too. However it comes at a cost, branching is made really difficult as is tagging and simply keeping everything up to date. Our latest method is to bring both projects into one repos including all the shared repos too. This gives us one "mega project" which slows clone time (check out in SVN) but we do that so rarely that the gains of not having to deal with sub-repos makes it well worth while. We now use feature switching/toggling rather than branching which also simplifies our development greatly.

推荐答案

如果我正确理解,您可能会喜欢以下结构:

If I understand correctly you have something like the following structure:


  • project1


    • 树干


      • 库(通过 svn:externals库svn:// repo / library

      • project1
        • trunk
          • library (via svn:externals library svn://repo/library)

          • 版本1


            • 库(通过 svn:externals库svn:// repo / library

            • release1
              • library (via svn:externals library svn://repo/library)

              • 库(通过 svn:externals库svn:// repo / library

              • library (via svn:externals library svn://repo/library)

              • 树干


                • 库(通过 svn:externals library svn :// repo / library

                • trunk
                  • library (via svn:externals library svn://repo/library)

                  • 版本1


                    • 库(通过 sv n:外部库svn:// repo / library

                    • release1
                      • library (via svn:externals library svn://repo/library)

                      我假设您正在设置<$ c / project1 / trunk上的$ c> svn:externals 到/ library。如果然后将修订与 svn:externals 合并到/ project1 / branches / release1并更新该分支,则将自动从库中获取最新版本。默认情况下,svn:externals将获得链接的HEAD版本。

                      I'm assuming you are settings svn:externals on /project1/trunk to /library. If you then merge the revision with the svn:externals to /project1/branches/release1 and update that branch, you will automatically get the latest version from the library. By default svn:externals will get the HEAD revision of the link.

                      您可以将 svn:externals 定义为链接到特定版本,例如: svn:externals -r123库svn:// repo / library 。这意味着外部链接将始终指向该特定修订版。因此,您可以在发行分支中安全地使用这种类型的 svn:externals 链接,而不必担心共享库代码将永远被更新,除非您手动更改 svn:externals

                      You could define the svn:externals to link to a specific revision, like this: svn:externals -r123 library svn://repo/library. This means that the externals link will always point to that specific revision. So you can safely use this type of svn:externals link in your release branch without worrying that the shared library code will ever be updated unless you manually change the svn:externals

                      可能更好的方法是将标记用于共享库并链接到特定标记。
                      在这种情况下,您将获得以下存储库结构:

                      Probably a better way would be to use tags for the shared library and link to a specific tag. In this case you would get the following repository structure:


                      • project1


                        • trunk


                          • 库(通过 svn:externals库svn:// repo / library / tags / version3

                          • project1
                            • trunk
                              • library (via svn:externals library svn://repo/library/tags/version3)

                              • 版本1


                                • 库(通过 svn:externals库svn:// repo / library / tags / version1

                                • release1
                                  • library (via svn:externals library svn://repo/library/tags/version1)

                                  • 库(通过 svn:外部库svn:// repo / library / tags / version2

                                  • library (via svn:externals library svn://repo/library/tags/version2)

                                  • 树干


                                    • 库(通过 svn:externals库svn:// repo / library / tags / version2

                                    • trunk
                                      • library (via svn:externals library svn://repo/library/tags/version2)

                                      • 版本1


                                        • 库(通过 svn:externals库svn:// repo / library / tags / version1

                                        • release1
                                          • library (via svn:externals library svn://repo/library/tags/version1)

                                          • 标记


                                            • version1

                                            • version2

                                            • version3

                                            这篇关于SVN:发布分支和外部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆