Synopsis: import [-options] repository vendortag releasetag…
Requires: Repository, source distribution directory.
Changes: repository.
Use import to incorporate an entire source distribution from an outside source (e.g., a source vendor) into your source repository directory. You can use this command both for initial creation of a repository, and for wholesale updates to the module from the outside source. 第 13 章, for a discussion on this subject.
The repository argument gives a directory name (or a path to a directory) under the cvs root directory for repositories; if the directory did not exist, import creates it.
When you use import for updates to source that has been modified in your source repository (since a prior import), it will notify you of any files that conflict in the two branches of development; use checkout -j to reconcile the differences, as import instructs you to do.
If cvs decides a file should be ignored (使用 cvsignore 忽略某些文件 在 附录 C), it does not import it and prints I followed by the filename (import output, for a complete description of the output).
If the file $CVSROOT/CVSROOT/cvswrappers exists, any file whose names match the specifications in that file will be treated as packages and the appropriate filtering will be performed on the file/directory before being imported. cvswrappers文件 在 附录 C.
The outside source is saved in a first-level branch, by default 1.1.1. Updates are leaves of this branch; for example, files from the first imported collection of source will be revision 1.1.1.1, then files from the first imported update will be revision 1.1.1.2, and so on.
At least three arguments are required. repository is needed to identify the collection of source. vendortag is a tag for the entire branch (e.g., for 1.1.1). You must also specify at least one releasetag to identify the files at the leaves created each time you execute import.
Note that import does not change the directory in which you invoke it. In particular, it does not set up that directory as a cvs working directory; if you want to work with the sources import them first and then check them out into a different directory (获取源文件 在 第 1 章).
This standard option is supported by import (通用命令选项, for a complete description):
Use message as log information, instead of invoking an editor.
There are the following additional special options.
Indicate the keyword expansion mode desired. This setting will apply to all files created during the import, but not to any files that previously existed in the repository. See 替换模式 在 第 12 章, for a list of valid -k settings.
Specify file names that should be ignored during import. You can use this option repeatedly. To avoid ignoring any files at all (even those ignored by default), specify `-I !'.
name can be a file name pattern of the same type that you can specify in the .cvsignore file. 使用 cvsignore 忽略某些文件 在 附录 C.
Specify file names that should be filtered during import. You can use this option repeatedly.
spec can be a file name pattern of the same type that you can specify in the .cvswrappers file. cvswrappers文件 在 附录 C.
import keeps you informed of its progress by printing a line for each file, preceded by one character indicating the status of the file:
The file already exists in the repository and has not been locally modified; a new revision has been created (if necessary).
The file is a new file which has been added to the repository.
The file already exists in the repository but has been locally modified; you will have to merge the changes.
The file is being ignored (使用 cvsignore 忽略某些文件 在 附录 C).
The file is a symbolic link; cvs import ignores symbolic links. People periodically suggest that this behavior should be changed, but if there is a consensus on what it should be changed to, it doesn't seem to be apparent. (Various options in the modules file can be used to recreate symbolic links on checkout, update, etc.; The modules file 在 附录 C.)
See 第 13 章, and 建立一个目录树 在 第 3 章.