我如何在没有初始签出的情况下在CVS中列出文件? [英] How can I list files in CVS without an initial checkout?
问题描述
如何在不进行初始检出的情况下列出CVS文件?
How can I list files CVS without an initial checkout?
在Subversion中,我可以简单地在CVS中执行"svn ls http://svn.svn.com 我可以这样做吗?
In subversion I can simply do "svn ls http://svn.svn.com" in CVS how can I do this?
例如,我有此CVS连接:
For example I've got this CVS connection:
pserver:anonymous@evocms.cvs.sourceforge.net:/cvsroot/evocms
如何列出其中的所有文件?
How can I list all files in it?
更新:
我正在这样做:
c:\>set CVSROOT=pserver:anonymous@evocms.cvs.sourceforge.net:/cvsroot/evocms
c:\>cvs -list ---> doesn't work, prints out the help screen
推荐答案
如果是一次性操作,则无需设置CVSROOT
环境变量.只需使用-d
自变量指定临时存储库规范.
If it's a one-off operation you don't need to set the CVSROOT
environment variable. Just use the -d
argument for ad-hoc repository specification.
如果您的CVS/CVSNT版本不太旧(准确地说,您需要CVS 1.12.8或更高版本或CVSNT),那么就像其他人所说的那样,登录后
If your version of CVS/CVSNT is not too old (to be exact you'd need either CVS 1.12.8 or higher or CVSNT) then, as others have said, after having logged in
cvs ls
应该可以正常工作.
如果您的CVS/CVSNT版本不支持ls
命令,则可以尝试
If your version of CVS/CVSNT does not support the ls
command then you can try
cvs checkout -c
只会转储预定义的模块的列表.
which will only dump the list of predefined modules.
如果您的CVS/CVSNT版本足够老,则可能会受到以下黑客的攻击(除非在服务器上启用了兼容模式,否则不能与更新版本的CVSNT一起使用):
If your version of CVS/CVSNT is old enough you might get lucky with the following hack (does not work with more recent versions of CVSNT unless compatibility mode has been enabled on the server):
首先将存储库的根检出到某个临时位置,这样我们就有了必要的元数据:
First check out the root of the repository to some temp location , so we have the necessary metadata:
cvs -d[your CVSROOT string] co -l -dTemp .
然后模拟该文件夹的更新(带有目录):
Then simulate an update (with directories) of that folder:
cd Temp
cvs -n up -d
这将发出(几乎)与实际结帐相同的输出,而无需实际从服务器获取文件.
This will emit (almost) the same output as an actual checkout without actually getting the files from the server.
如果您使用Windows,并且使用CVSNT的较新版本作为客户端,则cvs ls
实际上会在检测到不支持ls
本身的服务器时自动退回到该机制.
If you're on Windows and using a fairly recent version of CVSNT as the client then cvs ls
will actually automatically fall back to this mechanism when it detects a server that does not support ls
itself.
哦,是的,并且AFAICT不存在cvs -list
之类的东西.它甚至不是有效的CVS命令行语法:-list
必须是全局参数,而不是命令,因为它直接在cvs
之后出现,并且没有指定实际的命令.但是再说一次,所有多字母参数(例如--help
)都必须以双破折号开头,例如cvs --version
.你们是否都在想cvs list
仅仅是cvs ls
的别名?
Oh yes, and AFAICT there is no such thing as cvs -list
. It's not even valid CVS command line syntax: -list
would have to be a global argument rather than a command as it follows directly after the cvs
and there is no actual command specified. But then again, all multi-letter arguments (such as --help
) would have to start with a double dash, e.g. cvs --version
. Were you all maybe thinking of cvs list
which would be a mere alias for cvs ls
?
这篇关于我如何在没有初始签出的情况下在CVS中列出文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!