Plastic SCM fast-import

Git's fast-export format is becoming a very popular method to exchange historic data between different version control systems. As of version 4.0, Plastic SCM supports the Git fast-export format for both importing and exporting as well as marks files for incremental operations.

Both operations are available on the command line client, through the commands

cm fast-import

and

cm fast-export

The documentation below can also be retrieved using passing the --help argument to the cm fast-export and cm fast-import commands.

Fast-import

Imports Git fast-export data into a repository.

Usage

    cm fast-import | fi <repspec> <fast-export-file>
                        [--import-marks=<marks_file>]
                        [--export-marks=<marks_file>]
                        [--stats] [--branchseparator=<chr_separator>]
                        [--nodata] [--ignoremissingchangesets] [--mastertomain]
  • repspec: the repository on which the data will be imported. It is created if it did not previously exist.
  • fast-export-file: the file with the repository data in Git fast-export format.

Options

  • --import-marks: The marks file used for incremental imports. This file has been previously exported by --export-marks. The changesets described in this file will not be imported because they were already in a previous import.
  • --export-marks: The file where the imported changesets will be saved. This file is used in a later fast-import to signal the changesets that have been already imported.
  • --stats: Prints some statistics about the import process
  • --branchSeparator=chr_separator: Plastic SCM uses "/" as default separator in the branch hierarchy. This option allows using char as a hierarchy separator, so main-task-sub would be mapped in Plastic SCM as /main/task/sub.
  • --nodata: Imports Git fast-export without including the data. This is useful to check if the import will run correctly.
  • --ignoremissingchangesets: Any changesets that cannot be imported are discarded and the fast-import operation continues without them.
  • --mastertomain: Imports using main instead of master.

Examples

  • Imports the contents exported in the repo.fast-export file into the mynewrepo repository on server atenea:8084:

    cm fast-import mynewrepo@atenea:8084 repo.fast-export
    
  • Imports the contents exported in the repo.fast-export file into the mynewrepo repository on server atenea:8084 and creates a marks file to perform incremental imports later:

    cm fast-import repo@server:8084 repo.fast-export --export-marks=repo.marks
    
  • Imports the contents of the repo.fast-export file. Only the new changesets that were not in the marks file are imported. The same marks file is used to save the list of changests again for the next incremental import:

    cm fast-import repo@server:8084 repo.fast-export --importmarks=repo.marks --export-marks=repo.marks
    

Remarks

To export a git repository, use a command like this:

  git fast-export --all -M --signed-tags=strip --tag-of-filtered-object=drop > ..\git-fast-export.dat
  • The -M option is important to detect moved items.
  • The specified repository is created in case it didn't exist.
  • Incremental import is supported using a marks file that contains the changesets previously imported ( --import-marks and --export-marks files). This means that only the new changesets that were not imported in the previous fast-import will be imported.

Get further information here .