Move a file

With the pbl.py move command, you can move files or directories within a project, or even between projects.

The syntax for this command is a bit different than the rest of the commands, because the other commands only operate on one project or file or directory at a time, and that is not the case the the move operation.
To move a file, run the pbl.py move command with these options. In the simplest case, we move a file, or a directory and all its contents, from one name to another.
--srcproj projname
The name of the project the source file is located in.
--destproj projname
The name of the project to move the file to. If left blank, defaults to value of --srcproj.
--srcpath path
The path to the file or directory to move.
--destpath path
The destination path for the file or directory specified in --srcpath. Two important things to note about this option:
  • If you specify a path which does not exist, that path will be automatically created for you as part of the move.
  • If the --destpath parameter ends with a slash ("/"), the destination will be assumed to be a directory. If it does not end with a slash, the destination will be assumed to be a file. An example of this behavior is below. This is approximately how the UNIX "mv" command behaves.
--srctype {pub|priv}
The visibility type of the source file, either pub or priv.
--desttype {pub|priv}
The visibility type of the destination file, either pub or priv.
--force
If the destination file exists, the --force option must be used to replace it.
Note: Because destpath does not end with a slash -- /foo/bar/baz/Release_old.zip -- the last component of the path is interpreted as "a file named 'Release_old.zip'".
pbl.py move -l http://$external_host/TeamForge Lab Management_api/1 --srcprj=myproject --srctype=pub --srcpath=/foo/bar/baz/Release.zip --destpath=/foo/bar/baz/Release_old.zip
To move a file from one project to another, and also change it from public to private, run the command like this.
Note: Because destpath ends with a slash -- "/foo/bar/baz/archive/" -- the last component of the path is interpreted as "a directory named 'archive'".
pbl.py move -l http://$external_host/TeamForge Lab Management_api/1 --srcprj=myproject --destproj=myproject_archive --srctype=pub --desttype=priv --srcpath=/foo/bar/baz/Release.zip --destpath=/foo/bar/baz/archive/