CVS:使用其祖先更新文件,但不更新其兄弟文件

发布于 2024-07-18 18:33:01 字数 639 浏览 4 评论 0原文

我在 CVS 中的 x/y/f.txt 下有一个文件。 在我的本地副本中,我有 x/,但没有 x/y/,并且我想从存储库中获取 f.txt。 是否有 CVS 命令行开关的任何组合,可以使其仅提取 x/y/f.txt 及其所有祖先(在本例中 x/y/ )但没有任何附属文件(例如 x/y/g.txtx/z)?


到目前为止我发现的唯一方法是:

cvs up -d -l x/y
# ... but be careful not to pass -P (``prune'') implicitly via your ~/.cvsrc
# ``-l'' means act locally, i.e. no recursion
# Do the above for every missing ancestor directory, in left-to-right order
# And ultimately:
cvs up x/y/f.txt

但是,对于 shell 脚本来说,分割路径并迭代祖先是相当不优雅的,所以我仍在寻找一个好的解决方案。

I have a file in CVS under x/y/f.txt. In my local copy, I have x/, but no x/y/ and I want to fetch f.txt from the repo. Is there any combination of CVS command-line switches which can make it pull only x/y/f.txt with all of its ancestors (in this case x/y/) but without any collateral files (such as x/y/g.txt or x/z)?


The only way I've found so far is:

cvs up -d -l x/y
# ... but be careful not to pass -P (``prune'') implicitly via your ~/.cvsrc
# ``-l'' means act locally, i.e. no recursion
# Do the above for every missing ancestor directory, in left-to-right order
# And ultimately:
cvs up x/y/f.txt

However, it would be rather inelegant for a shell script to split a path and iterate through the ancestors, so I'm still looking for a good solution.

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

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

发布评论

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

评论(1

初心 2024-07-25 18:33:01

您是否已签出工作副本或者这是用于重新签出?

如果您已经有工作副本,cvs up -dx/y/f.txt 应该可以完成这项工作。

仅当 xy 文件夹尚不存在时才需要 -d。 如果它们确实存在,您也可以cd进入x/y文件夹并执行cvs up f.txt

如果这是一次全新的结帐,那么 cvs co -N x/y/f.txt 可能就是您所需要的。

Do you already have a working copy checked out or is this for a fresh checkout?

If you already have a working copy cvs up -d x/y/f.txt should do the job.

The -d should only be necessary if the x and y folders do not already exist. If they do exist, you can also just cd into the x/y folder and do cvs up f.txt.

If this should be a fresh checkout then cvs co -N x/y/f.txt is probably what you need.

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