2010-08-09 126 views
19

是否有命令返回CVS存儲庫中包含的模塊名稱列表?如何列出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版本是22年1月11日

+0

其實我是想運行':EXT:'模式,如果有差別。 – Zaid 2010-08-09 07:13:45

回答

15

正如this answer所述,基本上有三種方法可以解決這個問題。哪一種適合您的情況首先取決於您在客戶端和服務器上使用哪些版本的CVS,其次取決於您對「模塊」的定義。

  1. 如果你指的是模塊,它們是由CVS的作者,即作爲CVSROOT/modules文件條目原本以爲的那麼cvs co -ccvs co -s會給你的,兩者之間的唯一的區別是後者將按「狀態」對輸出進行排序。你可以閱讀這裏的模塊文件: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了-d

+0

這個答案的要點是什麼?只是一個評論指向另一個答案 – manojlds 2013-09-17 08:58:30

+0

@Oliver,基本上只是鏈接的答案不被認爲是好的,並可能最終被刪除(你的已經在標誌隊列中)。爲了防止這種情況,請考慮在這裏引用該答案的相關部分到您的答案中(並確保將原始作者歸因)。您可以將鏈接留在原始答案中,但這樣您的答案將獨立存在。 – 2013-09-17 11:01:23

+1

@Ben:完成。我也是原始答案的作者。 – 2013-09-18 20:51:26

0

您可以運行

cvs ls 

列出樹CVS> = 1.11(見CVS --version),或運行

cvs checkout CVSROOT/modules 

看到模塊配置文件。

+0

'ls'不被識別。這兩個同義詞都沒有[由Dewfy建議](http://stackoverflow.com/questions/3437885/how-can-i-list-all-modules-in-a-cvs-repository/3437948#3437948) – Zaid 2010-08-09 07:11:03

+0

是的,你需要CVS 1.11或以上。我認爲它在客戶端和服務器上都是必需的。 但是,即使使用舊版本,模塊文件也應該可用。 – Mikel 2010-08-15 02:26:37

1

使用下列內容:

cvs -d /usr/local/cvs ls 

根據這一http://www.cvsnt.org/manual/html/ls.html有同義詞:目錄,目錄,RLS

,當然還有不原諒通過審查所有可用的命令:

cvs --help-commands 
+0

'ls'及其同義詞不被識別爲命令。看到我的評論[米克爾的答案](http://stackoverflow.com/questions/3437885/how-can-i-list-all-modules-in-a-cvs-repository/3437915#3437915) – Zaid 2010-08-09 07:11:47

+0

@Zaid - 可以你請執行:cvs --help-commands 並徵用結果 – Dewfy 2010-08-09 08:25:15

+0

我已更新我的帖子來回答你的問題 – Zaid 2010-08-09 08:55:26