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: the Scan Threshold on page 248.
Using “pop” Outside a Workspace
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.
Sometimes you want to grab an element from a particular point in time, and do not intend to modify or promote it—for example, to build a software package with a component from last week, to track down a build issue. The
pop -t command allows you to do this easily, without the necessity of setting up a time-basis stream and then using
pop -v to access a particular version.
•
|
Time in <YYYY/MM/DD HH:MM:SS> format: e.g. 2007/08/07 20:27:15. Note that you might need to use quotes in composing the argument following –t; the entire argument must be 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.
<AcResponse Command="pop"
TaskId="1108">
<message>Populating element \.\dir00\sub00\file06.txt</message>
<element location="/dir00/sub00/file06.txt"/>
</AcResponse>
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:
> pop -L . -D -v my_stream dir1/dir2/dir3/dir4/file.txt
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):
> pop -L . -D -v my_stream dir1/dir2/dir3/dir4/file1.txt dir1/file1.txt
Copy elements associated with transaction id 68456, overwriting existing files and using recursion: