Subversion 中的单一多用户结帐 - 可能吗?

发布于 2024-07-08 07:57:26 字数 205 浏览 14 评论 0原文

在我们的组织中,我们存在以下问题。 我们希望我们的网络树版本受到控制,但我们中的许多人希望能够更改(并签入)该树的任何文件。 我们还希望所有这些都只有一次签出,因为树相当大。 对于该树的某些部分,我们目前正在使用 RCS,它允许上述行为,但当然还有其他一些缺点。

有谁知道如何在 Unix 服务器上使用 Subversion 做这样的事情(也许需要某种解决方法)?

In our organization, we have the following problem. We want to have our web tree revision-controlled, but many of us want to be able to alter (and check in) any file of that tree. We would also like there to be only a single check-out for all this because the tree is rather huge. For parts of that tree, we are currently using RCS, which allows for the behavior described above, but has several other drawbacks, of course.

Does anyone know how to do such a thing (maybe with some kind of workaround) with Subversion on a Unix server?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(10

○闲身 2024-07-15 07:57:27

为什么不直接检查一下您有兴趣更改的树的部分呢? 那应该不是问题。 也许我对“单次退房”的意思感到困惑。

Why not just check out the bit of the tree you're interested in changing? That shouldn't be a problem. Maybe I'm confused about what you mean by "a single check-out".

宛菡 2024-07-15 07:57:27

@Lytha:我知道 RCS 是基于锁的,在我们的场景中我们对此没有任何问题。 我也知道您可以使用带有锁定的 SVN,但是每用户签出问题仍然存在......

@Lytha: I know that RCS is lock-based, and we have no problem with that in our scenario. I also know that you can use SVN with locking, but the per-user check-out problem persists...

白日梦 2024-07-15 07:57:27

磁盘驱动器很便宜。 让每个开发人员检查树的副本。 Subversion 解决了锁定问题,因此每个用户都有自己的副本,不会干扰其他人进行更改。 如果每个人都检查并管理自己的源代码树开发版本,那么您的工作效率将会大大提高,并且对更改有更好的责任。

Disk drives are cheap. Let each developer check out a copy of the tree. Subversion solves the locking issue, so each user having their own copy does not interfere with others making changes. You'll be much more productive and have better accountability for changes if each person checks out and manages their own development version of the source tree.

苍白女子 2024-07-15 07:57:27

在典型的 SVN 环境中,每个用户都有自己的(完整或部分)树副本,她可以在其中对树进行任何她想要执行的更改,而不会打扰或破坏她的同事。 然后她决定要签入什么。所有其他人都可以在他们认为最好的时间结账。 主要(部署)用户定期检查(每日构建)以检查完整性。

我认为你的困惑是 RCS 与 CVS/subversion 相比:RCS 在编辑时阻止所有其他文件,SVN 不会阻止任何内容(通常。阻止是可能的,但很少使用)。

In a typical SVN environment, every user has her own (complete or partial) copy of the tree, where she can do any changes she wants to perform on the tree, without disturbing or breaking her co-workers. Then she decides what to check in. All others can checkout, whenever they think it is the best time to do so. and the main (deployment) user checks out regularily (daily build) to check for integrity.

I think your confusion is RCS in comparison to CVS/subversion: RCS blocks a file for all others while editing, SVN doesn't block anything (normally. blocking is possible but rarely used).

热鲨 2024-07-15 07:57:27

正如您可能从其他帖子中看到的那样,这个问题的一般答案是“不要这样做”。 一般来说,Subversion 用于将部分或全部存储库单独检出到本地工作区。

如果您绝对肯定地必须了解每个开发人员的整个存储库,但开发人员只更改了一小部分,那么这里有一个可能的解决方案。 您需要开发一些脚本来促进我所描述的内容(基于我曾经使用的 UNIX IDE)。

根据您的评论,我还假设环境是 UNIX 或 Linux - 我认为以下情况在 Windows 中是不可能的。

  1. 在某个位置以只读方式检出整个项目。 确保所有开发人员都对其具有读取权限。
  2. 拥有一个开发人员可以执行的脚本,该脚本可以抓取目录结构,使用指向该开发人员工作区中的只读目录的符号链接创建该结构的镜像。
  3. 当签出树的一部分进行编辑时,删除符号链接并从 Subversion 签出该路径(您可能需要一个脚本来包装 svn 命令来处理此问题
  4. ) svn commit 或在单独的脚本中,您可能需要删除工作区目录并重新建立符号链接。
  5. 通过 Subversion 中的 post-commit 挂钩或定期使用 cron 或类似工具更新只读副本。

符号链接为每个开发人员提供整个树的视图,并允许仅对开发人员正在积极编辑的树部分进行“本地”签出。

迂回的原因是 Subversion 确实不打算以这种方式使用。 然而,对于您所描述的情况,这种方法会起作用,但会带来一些痛苦。

As you've probably seen from the other posts, the general answer to this issue is "Don't do that." Generally speaking, Subversion is used for individual checkouts of some or all of a repository to the local workspace.

If you absolutely, positively, must have a view of the entire repository per developer, but a developer is only changing a small portion, here's a potential solution for you. You'll need to develop a few scripts to facilitate what I'm describing (which is based on a UNIX IDE I used to use).

I'm also assuming, from your comments, that the environment is UNIX or Linux - I don't think the following is possible in Windows.

  1. Check-out as read-only the entire project in some location. Ensure that all developers have read access to it.
  2. Have a script a developer can execute that crawls the directory structure creating a mirror of the structure using symbolic links to the read-only directory in that developer's workspace.
  3. When checking out a portion of the tree to edit, delete the symlink and check-out that path from Subversion (you'll probably want a script to wrap svn commands to handle this)
  4. Either on svn commit or in a separate script, you'll probably want to delete the workspace directory and re-establish the symlink.
  5. Have the read-only copy updated, either through a post-commit hook in Subversion or periodically with cron or something similar.

The symlinks provide a view of the entire tree per developer, and allow for a "local" checkout of only those portions of the tree that the developer is actively editing.

The reason for the circumlocutions is that Subversion really wasn't intended to be used in this manner. However, this method will work, with some pain, for what you describe.

蓝天白云 2024-07-15 07:57:27

我建议您为所有开发人员都可以访问的网络树使用一个特殊帐户,并以该用户的身份检查网络树。

I'd suggest that you use one special account for the web tree which all developers have access to, and check out the web tree as that user.

醉酒的小男人 2024-07-15 07:57:27

@Jesper:是的,这是可能的。 所有成员的额外帐户,可能还有额外的 sudo 规则。

@Jon:问题是,基本上我们所有人都需要更改树的某些部分中的某些文件。 这就是为什么我们都需要整棵树,但我们不想有那么多的签出。

@Jesper: Yes, that would be possible. An extra account for all members, maybe with an additional sudo rule.

@Jon: The thing is that basically all of us need to change some files in some part of the tree. That's why we all need the whole tree, but we do not want to have that many check-outs.

为你鎻心 2024-07-15 07:57:27

Subversion 允许您检查树的任何部分,并且 1.5 版本还支持 结账稀疏。 这意味着您可以将签出微调到单个目录级别(但不能像 RCS 那样调整到单个文件级别)。

例如,如果您的存储库如下所示:

Repository Root
  tags
  branches
  trunk
    doc
    src
      module1
        resources
      module2
    images

您可以使用以下命令仅查看 module1 目录(而不是其子目录)中的文件:

svn checkout --depth=files svn://server/repository/trunk/src/module1

如果您还需要子目录内容,您可以调整稍后结帐,请参阅文档。

Subversion allows you to check out any portion of the tree, and with version 1.5 also supports sparse checkouts. What this means is you can fine-tune your checkout to the individual directory level (but not as far as the individual file level as RCS can go).

So for example, if your repository looks like this:

Repository Root
  tags
  branches
  trunk
    doc
    src
      module1
        resources
      module2
    images

You can check out only the files in the module1 directory (and not its subdirectories) using this:

svn checkout --depth=files svn://server/repository/trunk/src/module1

If you also need subdirectory content you can adjust the size of your checkout later, see the documentation.

星星的轨迹 2024-07-15 07:57:27

如果您担心查看工作副本时的延迟/带宽,请记住工作副本是完全独立的。 这意味着您可以签出一个巨大的存储库,然后只需将该“工作副本”复制给需要它的任何人。

同样的技巧也适用于分支 - 如果您有主干的最近未更改的工作副本,您可以简单地复制它,然后将其“svn switch”到新分支。

  1. 将巨大的存储库签出到base_working_copy(过夜?)
  2. cp -a base_working_copy my_working_copy (以及其他需要它的人)
  3. cp -a base_working_copy my_branch
  4. cd my_branch
  5. 将我的分支切换到任何分支URL

我也成功地使用它来蜗牛邮件大型工作副本的cd对于有带宽问题的人。

另请参阅:在一个非常非常大的网站上使用 Subversion

If it is delay/bandwidth in checking out a working copy that worries you, bear in mind that the working copy is entirely self contained. This means that you can do your checkout of a huge repository, and then simply copy that "working copy" to whoever needs it.

The same trick also works nicely for branches - if you have an unaltered recent working copy of trunk you can simply copy it and then 'svn switch' it to a new branch.

  1. Checkout huge repository to base_working_copy (overnight?)
  2. cp -a base_working_copy my_working_copy (and to whoever else needs it)
  3. cp -a base_working_copy my_branch
  4. cd my_branch
  5. switch my branch to whatever branch URL

I've also used this successfully to snailmail cds of big working copies to people with bandwidth problems.

See also: using subversion with a really really big site

单身狗的梦 2024-07-15 07:57:26

开发者不是用自己的机器吗? 该树是否太大以至于必须将其检出到服务器上的共享网络驱动器上,因为它不适合个人开发人员的工作站? 我认为这个问题需要一些数字来进一步澄清问题和背后的推理。

Are the developers not on their own machines? Is the tree so huge that it must be checked-out onto a shared network drive on a server, since it doesn't fit on individual developers' workstations? I think this question needs some numbers to clarify the problems and reasoning behind it further.

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