開發代碼時如何使用 Internet Subversion 存儲庫? (How to use an Internet Subversion respository when developing code?)


問題描述

開發代碼時如何使用 Internet Subversion 存儲庫? (How to use an Internet Subversion respository when developing code?)

I've painted my self into a problem working with a Subversion project from CodePlex ‑ for this I asked for help here. I have a local repository and CodePlex has it's Internet repository for the project, and the two don't mix :‑(.

But my dear departed dad used to tell me that the difference between a clever man and a wise man is that the wise man does not enter the trap a clever man find his way out of. In other words: I must have been doing something wrong. So:

Say you're a group of a few developers. There's a Subversion controlled project on the Internet you want to start modifying. You want to work on it locally, changing it to suit your needs. You want local version control. You want to control which Internet changes to accept to your repository  ‑ those that are relevant and important and don't cause noise.  You want to commit to the Internet some of your local changes ‑ those that you're sure that are stable, and that are relevant to the whole community.

This method of operation seems to me common sense, but then I've never worked on an open source project. So:  1. Is this indeed a common method of operation and  2. How do you go about doing it with Subversion without getting into trouble?

‑‑‑‑‑

參考解法

方法 1:

Subversion is inherently a centralized revision control system. From your description, it sounds like you want a distributed revision control system. In such a system people can develop locally and then exchange their units of work (called changesets) between each other. Distributed revision control systems have excellent support for merging branches to support this.

I'm using Mercurial myself and would recommend it for a Subversion user since many of its commands a similar to the commands in Subversion. Others popular tools in this category include Git and Bazaar.

方法 2:

Absorbing changes from an external source ("vendor drops") into your own local repository is covered in the SVN book in the section Vendor Branches.

Alternatively, you could just use the merge command to cherry pick revisions from a folder in repository A and apply those changes to a working copy of a folder in repository B. The merge command seems to have some support for this (at least in the latest version) so it probably works much like merging between local branches (minus the automatic merge tracking).

方法 3:

  

Say you're a group of a few   developers. There's a Subversion   controlled project on the Internet you   want to start modifying. You want to   work on it locally, changing it to   suit your needs. You want local   version control. You want to control   which Internet changes to accept to   your repository ‑ those that are   relevant and important and don't cause   noise.

You want to be able to work locally, and branch or merge without a second thought.  You're basically talking about distributed version control.    Subversion does not support this.  You should instead use something like Mercurial or Git.

方法 4:

It sounds like you should be looking at creating a branch for your code in the original repository.  You can merge from trunk back to your branch, or the other way around, as you want.

Your other option is to export the files from the repository and add to your own repository.  But that's only going to be a pain in the future.  

方法 5:

This is much easier with Distributed Source Control systems, such as git.

then you can have a local git repository, use git‑svn to get updates from the public repo, and have your own local branch with your special tweaks.

You'll see many projects like this (extending subversion‑ed OSS projects using git) on github ‑ for NHibernate, for Castle project, etc.

if you must stick with SVN, you can manage your own change using a set of patch files over the public trunk. if you want newer stuff from trunk, create a patch with your changes, revert, update to the newer trunk, and then apply your patch selectively.

(by AviMartin GeislerWim CoenenMatthew FlaschenmarccKen Egozi)

參考文件

  1. How to use an Internet Subversion respository when developing code? (CC BY‑SA 3.0/4.0)

#repository #synchronization #codeplex #svn






相關問題

開發代碼時如何使用 Internet Subversion 存儲庫? (How to use an Internet Subversion respository when developing code?)

在線庫報告的錯誤 (Online repository for reported bugs)

如何在Subversion儲存庫歷史記錄中查找文件? (How Do I Find a File in a Subversion Repository History?)

如何從 Nexus Professional 遷移到 Nexus OSS (How to migrate from Nexus Professional to Nexus OSS)

如何查看存儲庫? (How to see repositories?)

將遠程 github 存儲庫中的更改合併到本地存儲庫 (Merge changes from remote github repository to your local repository)

如何為 Xcode 項目設置 Git 存儲庫? (How to set up a Git repository for an Xcode project?)

如何簽入從不同存儲庫簽出的代碼 (How to check in code which is checked out from different repository)

如何使 Hg/Git 成為遠程倉庫? (How to make Hg/Git a remote repo?)

繼承是一種“is-a”關係;總結“界面”關係的好方法是什麼?——總結其他關係? (inheritance is an 'is-a' relationship; What is a good way to summarize the 'interface' relationship? -- Summarizing other relationships?)

存儲庫模式問題 (Repository Pattern Question)

為 Mac 和 Windows 設置 React Native 代碼庫 (setting up react native code repository for Mac & Windows)







留言討論