如何列出CVS仓库中的所有模块?

21
有没有一条命令可以返回包含在CVS存储库中的模块名称列表?
作为一个对CVS不熟悉的新手,我想应该有类似以下的内容:
cvs -d /usr/local/cvs listmodules

我应该用什么替换listmodules来获取CVS存储库中所有模块的列表?


为了回应Dewfy的评论,cvs --help-commands返回以下内容:

    add          Add a new file/directory to the repository
    admin        Administration front end for rcs
    annotate     Show last revision where each line was modified
    checkout     Checkout sources for editing
    commit       Check files into the repository
    diff         Show differences between revisions
    edit         Get ready to edit a watched file
    editors      See who is editing a watched file
    export       Export sources from CVS, similar to checkout
    history      Show repository access history
    import       Import sources into CVS, using vendor branches
    init         Create a CVS repository if it doesn't exist
    kserver      Kerberos server mode
    log          Print out history information for files
    login        Prompt for password for authenticating server
    logout       Removes entry in .cvspass for remote repository
    pserver      Password server mode
    rannotate    Show last revision where each line of module was modified
    rdiff        Create 'patch' format diffs between releases
    release      Indicate that a Module is no longer in use
    remove       Remove an entry from the repository
    rlog         Print out history information for a module
    rtag         Add a symbolic tag to a module
    server       Server mode
    status       Display status information on checked out files
    tag          Add a symbolic tag to checked out version of files
    unedit       Undo an edit command
    update       Bring work tree in sync with repository
    version      Show current CVS version(s)
    watch        Set watches
    watchers     See who is watching a file

CVS 版本为 1.11.22


我实际上想在 :ext: 模式下运行,如果这有所不同的话。 - Zaid
3个回答

20

正如在这个回答中所描述的,基本上有三种方法可以实现列出CVS中的文件。哪种方法适合您的情况,首先取决于客户端和服务器上使用的CVS版本,其次取决于您对"模块"的定义。

  1. 如果您将模块理解为CVS作者最初想到的条目——也就是CVSROOT/modules文件中的条目,则cvs co -ccvs co -s将提供该信息。两者之间唯一的区别在于后者会按"状态"对输出进行排序。您可以在此处阅读有关modules文件的信息:http://cvsbook.red-bean.com/cvsbook.html#modules

  2. 如果您正在使用至少CVS 1.12.8或CVSNT,并且您对模块的概念更符合存储库内实际目录的话,则cvs ls应该是您需要的。

  3. 最后,如果您确实需要远程目录列表,但您的服务器运行较旧版本的CVS,则有一个技巧:首先执行"虚拟"检出,然后模拟递归更新:

    cvs -d [CVSROOT] co -l .

    cvs -n up -d


1
请使用以下内容:
 cvs -d /usr/local/cvs ls

根据这个http://www.cvsnt.org/manual/html/ls.html,有以下同义词:dir、list、rls。
当然,不要忘记通过以下方式查看所有可用命令:
cvs --help-commands

ls和它的同义词不被识别为命令。请查看我在Mikel's answer中的评论。 - Zaid
@Zaid - 你能否执行命令:cvs --help-commands,并列出结果。 - Dewfy
@Zaid - 太可惜了,看起来你使用了一些简短的 cvs,那么最简单的方法是执行 'export' 命令 - 这将最小影响本地文件系统。在某些情况下,选项-l(不使用递归)也可能有帮助。 - Dewfy

0

你可以运行

cvs ls

列出 CVS 版本 >= 1.11 的树形结构(见 cvs --version),或运行。
cvs checkout CVSROOT/modules

查看模块配置文件。


“ls”未被识别。Dewfy建议的同义词也未被识别。 - Zaid
是的,你需要 CVS 1.11 或以上版本。我认为客户端和服务器都需要这个版本。但即使使用旧版本,模块文件也应该可用。 - Mikel
没有模块文件 :/. - Carlo Wood

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接