The pop (“populate”) command loads versions of elements into your workspace. This sounds like a useful and common operation, but in practice, you may never need to use this command.
It is appropriate to use pop when you accidentally delete files. There is nothing AccuRev can do if you delete files that you have been editing, but have not yet preserved with
keep. (But the operating system may have an “undelete” facility, such as the Recycle Bin on the Windows desktop.) If you delete files that you have not modified, but still need (e.g. for searching, building, or testing), you can use
pop to get “fresh copies” of the files from the depot.
For each element, pop retrieves a version from the workspace stream. It’s the version that
should be in the workspace (but isn't because you deleted it), or
would be in the workspace (but isn't because you hadn't previously loaded it):
Note: If the
pop command is used with the
-v option, and any element specified in the
<list-file> or
<element-list> has status
(defunct) in the stream’s default group, the command will fail. If you are using a script to generate a list of files to
pop, check for this potential error condition.
pop is designed to “fill in the blanks”, not to replace existing files. Thus, the
pop default is to refuse to do anything if it would overwrite any file in the workspace. You can force
pop to overwrite existing files with the
-O option. It retrieves the version that was loaded (or left alone) by the most recent update.
Be very careful when using -O. If you have modified a file but not yet preserved it with
keep, then
pop -O overwrites what might be the only existing copy of the modified file.
By default, each file copied into your workspace by this command has its timestamp set to the current time. If environment variable ACCUREV_USE_MOD_TIME is set, the timestamp is set to the time the version was originally created. (Note: that’s the time the version was created in some user’s workspace stream, not the time it was subsequently promoted to the backing stream.) Setting this environment variable may defeat an optimization in the
stat command. See
Optimized Search for Modified Files.
You can use pop to copy versions of one or more elements from depot storage to a non-workspace location. Use the
-v option to specify the version to be copied; use the
-L option to specify the destination of the copy operation. Use
depot-relative pathnames to specify the elements to be copied. The current directory must not be within a workspace. Use the
-D option to copy only an element, without recreating its directory structure. Use the
--eol=unix option or the
--eol=windows option to specify the type of line terminators to write into the copied versions. (The
UNIX/Linux line terminator is NL, and the Windows line terminator is CR-NL.)
•
|
Time in <"YYYY/MM/DD HH:MM:SS"> format, " 2007/08/07 20:27:15", for example. Note that you must use quotes when specifying time-spec as YYYY/MM/DD HH:MM:SS to ensure that the entire argument is interpreted by the command shell as a single token.
|
Process the elements listed in <list-file>. This must be a text file, with one element name per line. Extra whitespace is not allowed; make sure there are no empty lines and no leading or trailing white space around the filenames. Wildcards are not expanded. There is no provision for comment lines in the file.
Copy foo.c from the workspace stream into the workspace:
Using versions from stream QA, copy the subdirectory tree starting at the directory
src to
C:\httpd\test_site:
Copy only file.txt from stream
my_stream to the current location, without creating the directory structure
dir1/dir2/dir3/dir4:
Copy only directory dir4 from stream
my_stream to the current location, without creating the directory structure above it (
dir1/dir2/dir3). dir4 will contain top-level elements. If
dir4 contains subdirectories, they will be created, but empty.
Copy file1.txt from two different directories in stream
my_stream, to the current location, without creating the directory structures above it. In this case, the second copy (from
dir1) overwrites the first one (from
dir1/dir2/dir3/dir4):
Copy elements associated with transaction id 68456, overwriting existing files and using recursion: