将多个项目保留在 Eclipse 中的同一 CVS 分支上

发布于 2024-08-23 02:55:56 字数 763 浏览 9 评论 0原文

因此,我的团队刚刚开始在我们的项目中使用分支,并且我们遇到了有关 Eclipse/CVS 处理分支和项目的方式的组织问题。我的问题是:

在Eclipse中是否可以通过CVS确保多个项目始终同步到同一个分支?

下面是一个简化的场景:

两个项目:ProjAProjB,以及两个分支:DevRelease

假设这两个项目都同步到我的工作区中的 Release,并且我决定添加一项新功能。我只预计此功能会触及 ProjA,因此我天真地仅将该项目分支到 Dev。所以现在我的工作空间不一致。

经过几个小时的工作后,我意识到我需要对 ProjB 进行一些小更改,因此我弹出有问题的文件并进行更改,忘记将其同步到 Dev< /代码>。

稍后,在我的更改完成后,我会提交它们。现在,我刚刚将第一个项目中的更改提交给 Dev,并将第二个项目中的更改提交给 Release。哇哦,构建损坏了!

这个问题的解决方案是:

  1. 不允许我分别同步两个项目
  2. 不允许我同时提交两个分支

现在,在现实世界中,我们有大约 30 个项目,并且许多开发人员正在开发功能分支,其中许多人似乎注定要使用分支来以任何可能的方式破坏构建。我想删除其中一些方式。

So my team is just starting to use branches on our project, and we've run into an organizational issue concerning the way Eclipse/CVS handle branches and projects. My question is this:

Is it possible to ensure that multiple projects are always synched to the same branch with CVS in Eclipse?

Here's a simplified scenario:

Two projects: ProjA and ProjB, and two branches: Dev and Release.

So let's say both projects are synched to Release in my workspace, and I decided to add a new feature. I only anticipate that this feature will touch ProjA, so I naively branch only that project to Dev. So now my workspace is inconsistent.

After a few hours of work, I realize that I need to make a small change to ProjB, so I pop open the file in question and make my change, forgetting to sync it to Dev.

Later, after my changes are complete, I commit them. Now, I've just committed the changes in the first project to Dev, and the changes in the second project to Release. Woohoo, broken build!

A solution to this problem would either:

  1. not have let me sync the two projects separately
  2. not have let me commit to two branches at the same time

Now, in the real world, we have about 30 projects, and a number of developers working on feature branches, many of whom seem destined to use branching to break the build any way possible. I'd like to remove some of those ways.

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

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

发布评论

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

评论(3

半衬遮猫 2024-08-30 02:55:56

更改 vcs 是一种选择吗?最近我的工作从 cvs 转变为 Mercurial,我认为我不能再回去了。我认为 Mercurial、git 或 bzr 中的任何一个都可以解决这些问题。

Is changing vcs an option? Having recently transitioned at my work from cvs to mercurial, I don't think I could go back. I think that any of mercurial, git or bzr would solve those issues.

尤怨 2024-08-30 02:55:56

经过大量试验和研究,似乎由于 CVS 中处理分支的方式(即,基于每个文件),像我所寻求的场景是不可能的(至少并非没有为此目的专门构建的一些工具)。

我们最终采用了一个软解决方案:通过将 Eclipse 中的 CVS 标签装饰的颜色和格式更改为更醒目的和隔离的内容,可以更轻松地识别项目(或文件)同步到哪个分支。

Eclipse 设置可在 Team > 中找到。 CVS>标签装饰>文本装饰常规>外观>颜色和字体>基本>装饰颜色

当然,一路上实施一些最佳实践。

After much trial and research, it seems that because of the way branches are handled in CVS (that is, on a per-file basis), a scenario like the one I seek is not possible (at least not without some tool special-built to this purpose).

We ended up just going with a soft solution: By changing the color and format of the CVS label decorations in Eclipse to something more striking and isolated, it's much easier to casually identify which branch a project (or file) is synched to.

The Eclipse settings are found at Team > CVS > Label Decorations > Text Decorations and General > Appearance > Colors and Fonts > Basic > Decoration Color.

And, of course, implementing some best-practices along the way.

过气美图社 2024-08-30 02:55:56

您可以在此处采取两种方法。

根据创建的 Eclipse 项目的分支来命名它们。因此,如果您正在开发处理 ProjA 的票号 123 的功能分支,您可以将 Eclipse 项目检查为 ProjA_123(如果您愿意,也可以检查为 ProjA_Dev)。您可以调用您的发布分支 ProjA_Release。

或者,您可以为每个分支维护单独的 Eclipse 工作区。

只要您有某种系统来识别您的工作结帐来自哪个分支,就应该没问题。

There are two approaches you can take here.

Name your Eclipse projects after the branch they're created. So if you're working on a feature branch for ticket number 123 dealing with ProjA you check out your Eclipse project as ProjA_123 (or ProjA_Dev if you wish). You can call your release branch ProjA_Release.

Alternatively you could maintain separate Eclipse workspaces for each branch.

So long as you have some system to identify which branch your working checkout is from, you should be fine.

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