鎖定串流中的檔案。
用途
容許使用者鎖定串流中的檔案。鎖定檔案可避免其他使用者交付會修改該檔案的變更集。
選項和引數
- [ -R | --remotePath ]
- 此旗標指出所有的路徑都是遠端。必須指定 –stream 和 –component。
- [ -s | --stream ] arg
- 指出應鎖定哪個串流。當使用 "-R" 時,必須指定此項。
- [ -c | --component ] arg
- 指出應鎖定哪個元件。當使用 "-R" 時,必須指定此項。
- files
- 要鎖定的一或多個檔案的路徑。視指定的 –R/--remotePath 而定,路徑可以是本端或遠端。
範例
指定個別檔案的路徑,就可以鎖定載入工作區之預設流程目標中的檔案:
$ scm lock acquire hello.world/build.xml
Locks successfully acquired.
在本例中,現行工作目錄中已載入一個工作區。已鎖定流程目標中的檔案。請注意,在本例中,使用者已針對適當的儲存庫執行 'scm login'。
指定 –stream,就可以鎖定不是預設流程目標之串流中的檔案:
$ scm lock acquire hello.world/build.xml --stream "JUnit Integration Stream"
Locks successfully acquired.
即使沒有載入工作區,也可以鎖定檔案:
$ scm lock acquire -r l --stream "JUnit Exploration Stream" --component BuildComp -R hello.world/chatter.txt hello.world/.project
Locks successfully acquired.
這個範例是鎖定 "JUnit Exploration Stream" 串流中,BuildComp 元件之 hello.world 目錄內的 chatter.txt 和 .project。請注意,使用 "-R" 表示路徑是遠端。