|
You use qget to retrieve a specific revision of a file that you previously stored in a QVCS archive. qget can also retrieve and lock a QVCS archive revision.
By default, qget retrieves the newest revision from the default branch of the QVCS archive.
If EXPANDKEYWORDS is enabled, qget expands any keywords in the revision being retrieved.
If CHECKLOCK is enabled, qget will fail if it cannot get the requested lock. This could be because someone else has the revision locked, or because you're not on the access list for the QVCS archive.
qget warns you if a writable copy of the work file already exists. This helps prevent overwriting a version of the work file that you've changed.
qget won't allow a locking get on an obsolete archive. In addition, qget won't retrieve any revision from an obsolete archive, unless you do a 'get by label' (see the -label option below). Further, for an obsolete archive, a 'get by label' using a floating label will not result in fetching a revision; 'get by label' will only get a revision from an obsolete archive if the label is anchored to a specific revision.
Command Template
qget [-l|-newer] [-q] [-ignoreobsolete] [-yes|-no|-proceed] [-r REVISION]|[-label LABEL]|[-datetime mm/dd/yyyy[:HH:MM:SS]] [-a ATTRIBUTE={YES|NO}] [-timestamp={now|edit|store}] [-o outfilename] filename
where:
-l (optional, cannot be used with -newer)
Indicates that the revision is to be locked. This means that no other users can lock that revision until you have either unlocked it, or used qput to update the locked revision. The default is not to lock the revision when it is retrieved.
-newer (optional, cannot be used with -l)
The requested revision will only be retrieved if it is newer than the target work file. The timestamp of the work file is compared to the time when the requested revision was checked in. If the work file doesn't exist, then it will be created when the revision is retrieved.
-q (optional)
The quiet flag. Indicates that qget should not display the informative message that it normally shows when fetching a revision.
-ignoreobsolete (optional)
Indicates that qget should ignore the requested operation if the archive is marked obsolete. This flag only has an effect if you are doing a 'get by label' (i.e. using the -label option). If you don't use this flag, qget will get a revision from an obsolete archive if that revision is associated with the label identified with the -label option. If you use the -ignoreobsolete option, then qget will skip all obsolete archives, even if the archive contains a revision associated with a label requested with the -label option.
-yes|-no|-proceed (optional)
Specifying one of these will provide qget with a response when it detects a writable copy of the output file and wants to know if it should overwrite the file. -yes indicates that it should overwrite any existing writable work files. -no indicates that it should not overwrite a writable file. If used with a wildcard qget, -no will cause qget to stop on the first writable output file it finds. -proceed behaves identically to -no, except that for wildcard qgets, it won't overwrite any writable output files, but it will continue trying to get all files that match the wildcard pattern.
-r REVISION (optional, cannot be used with ?label or -datetime)
Specifies the revision to be retrieved from the QVCS archive. By specifying the revision, qget will retrieve the indicated revision from the QVCS archive. By default (if no -r switch is used), qget retrieves the most recent revision on the default branch in the QVCS archive.
-label LABEL (optional, cannot be used with ?r or -datetime)
Causes qget to retrieve the revision associated with the LABEL. If more than one word, LABEL should be enclosed in single or double quotes.
-datetime mm/dd/yyyy[:HH:MM:SS] (optional, cannot be used with ?r or -label)
Causes qget to retrieve the revision on the default branch that was the tip revision at the given date-time.
-a ATTRIBUTE=YES or -a ATTRIBUTE=NO (optional)
Temporarily overrides the QVCS archive attribute specified by the ATTRIBUTE string. For qget, the ATTRIBUTE string may be EXPANDKEYWORDS or PROTECTWORKFILE. If EXPANDKEYWORDS=YES, keywords present in the QVCS archive will be expanded when the revision is fetched. If EXPANDKEYWORDS=NO, keywords will not be expanded. If PROTECTWORKFILE=YES, a non-locking fetch will leave the output file write-protected after the fetch. If PROTECTWORKFILE=NO, the output file will be writable in all circumstances. You can use both overrides in a qget by using the -a ATTRIBUTE pair two separate times on the same command line.
-timestamp={now|edit|store} (optional)
Chooses which timestamp qget will use to timestamp the retrieved file. A value of now (the default) sets the timestamp of the retrieved file to the current time; a value of edit sets the timestamp of the retrieved file to the edit time of the retrieved revision; a value of store sets the timestamp of the retrieved file to the time when the retrieved revision was stored in the QVCS archive.
-o outfilename (optional)
Causes qget to retrieve the revision into the file specified by outfilename, rather than the typical associated work file. If outfilename is not specified, qget will retrieve the revision into the current directory, overwriting filename. If using the -o option with a wildcard filename, outfilename must also be a wildcard name with wildcard characters in the same sequence as the wildcard characters used to specify the filename.
filename (required)
Filename from which the QVCS archive name is derived.
filename is taken to be the first word on the command line not preceded by one of the switches. To get all files within the current directory, you can use the wildcard character *. Likewise, you can use the wildcard character to get all files of a certain extension, etc. *.cpp, for example, will get all files ending in .cpp.
Examples
qget foobar.c
retrieves the latest revision from the default branch of foobar.c's QVCS archive into foobar.c in the current directory.
qget -l foobar.c
retrieves and locks the latest revision from the default branch of foobar.c's QVCS archive into foobar.c in the current directory.
qget -r 1.5 foobar.c
retrieves revision 1.5 from foobar.c's QVCS archive into foobar.c in the current directory.
qget -o poohbar.c -r 1.5 foobar.c
retrieves revision 1.5 from foobar.c's QVCS archive into poohbar.c in the current directory.
qget -a EXPANDKEYWORDS=NO -r 1.5 foobar.c
retrieves revision 1.5 from foobar.c's QVCS archive into foobar.c in the current directory. Any keywords present in foobar.c will NOT be expanded.
qget -o joe* *
retrieves the latest revision from the default branch of all QVCS archives accessible from the current directory into files whose names are constructed by taking the regular filename and adding a joe prefix. For example, foobar.c would be retrieved into joefoobar.c.
qget -datetime 05/12/2005 *.cpp
retrieves from the default branch of all .cpp files in the current directory the revision that would have been the tip revision on May 12, 2005.
qget -datetime 05/12/2005:08:00:00 *.cpp
retrieves from the default branch of all .cpp files in the current directory the revision that would have been the tip revision at 8am on May 12, 2005.
qget -l -r 1.2 foobar.c
retrieves revision 1.2 from foobar.c's QVCS archive and locks that revision for your exclusive use.
Command Line Utilities
See also: QWin's corresponding Get and Check Out tools.
|