CVS:使用其祖先更新文件,但不更新其兄弟文件
我在 CVS 中的 x/y/f.txt
下有一个文件。 在我的本地副本中,我有 x/
,但没有 x/y/
,并且我想从存储库中获取 f.txt
。 是否有 CVS 命令行开关的任何组合,可以使其仅提取 x/y/f.txt
及其所有祖先(在本例中 x/y/
)但没有任何附属文件(例如 x/y/g.txt
或 x/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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否已签出工作副本或者这是用于重新签出?
如果您已经有工作副本,
cvs up -dx/y/f.txt
应该可以完成这项工作。仅当
x
和y
文件夹尚不存在时才需要-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 thex
andy
folders do not already exist. If they do exist, you can also justcd
into thex/y
folder and docvs up f.txt
.If this should be a fresh checkout then
cvs co -N x/y/f.txt
is probably what you need.