NAME
bk set − set operations
SYNOPSIS
bk set [−adeklnosSx]
[−rrev] [−t[type]]
[file]
DESCRIPTION
The bk set command performs set operations on a
BitKeeper file. This command provides the following set
operations: union, intersection, difference and symmetric
difference. It also provides the member function (is this
element a member of the set?) as well as the list function
(list all sets which contain this member).
If the file is not specified, it defaults to the ChangeSet file.
OUTPUT
OPTIONS
The default output is a list of revisions, one per line. The
output may be restricted to only tagged revisions, and may
be forced into revision, tag, or key format. Note that only
the ChangeSet file may have tags, which means that combining
tag output format with a regular file has unexpected
results.
−k list all answers as keys, not as tags or
revisions.
−n prefix each output line with the filename,
i.e., ChangeSet|1.3, so that the output may be fed to other
programs, such as bk log.
−t list all answers as tags where possible, else
revisions.
−tt list only those answers which are tagged and
list those as the tag not the revision.
−tr list only those answers which are tagged but
list those as revisions.
−tk list only those answers which are tagged but
list those as keys.
SPECIFYING
SETS
If a revision is specified for a set argument, the set is
the set of deltas which make up that revision. For example,
in a simple history without branches, revision 1.5 implies
the set {1.1, 1.2, 1.3, 1.4, 1.5}. A revision may be
specified as a revision, as a symbolic tag, or as a
BitKeeper key. It may also be specified as a
“−”, for the second set only, in which
case it expects a list of revisions (or keys) on stdin, one
per line.
SET
OPERATIONS
UNION (setA | setB)
bk set [output opts] −o setA
setB [file]
The union operation, familiar to programmers as a “bitwise or”, lists all members which occur in either set.
INTERSECTION
(setA & setB)
bk set [output opts] −a setA
setB [file]
The intersection operator, familiar to programmers as a “bitwise and”, lists all members which occur in both sets.
DIFFERENCE
(˜setA & setB)
bk set [output opts] −d setA
setB [file]
The difference operator lists all members in setB which are not in setA. This is the most useful of the set operations, see the examples below.
SYMMETRIC
DIFFERENCE (setA ˆ setB)
bk set [output opts] −x setA
setB [file]
The symmetric difference operator, familiar to programmers as an “exclusive or”, lists all members which occur in only one of the two sets.
ELEMENT
bk set [output opts] −e
−rrev setA [file]
The element operator treats the specified revision as a single element, not as an implied set, and lists the element if it is in the set.
LIST
bk set −l −rrev [file]
The list operator treats the specified revision as a single element, not as an implied set, and lists all sets (as revisions) which contain the element as part of their set. It is typically used to see if a bug fix is in a particular release. If the changeset has been excluded from a later changeset, the later changeset and its descendants will not be listed.
SET
bk set −s −rrev [file]
The set operator treats the specified revision as a set, and lists all elements of that set.
NESTED
The set command will look at the product changeset file by
default.
−S perform the set operation on the current
component.
EXAMPLES
A good use of this command is the generation of release
notes. To do so, pick the starting and ending points and do
this:
$ bk set -d
-rbk-2.0 -rbk-2.0.1 | bk changes -
[email protected], 2001-10-12 15:18:06, lm@work
utils.c:
Remove debugging.
Sleep 50 milliseconds when waiting for the lock.
[email protected],
2001-10-15 15:57:42, lm@disks
A weekend’s worth of testing of locking over NFS
turned into this cset.
[email protected],
2001-10-16 08:35:26, lm@disks
The cset lock was too fine grained.
This is a short term fix,
the longer term fix is the per file locking
Andrew is working on.
TAG: bk-2.0.1
To see the tagged releases which contain bk-2.0.3:
$ bk set -l -tt
-rbk-2.0.3
bk-2.0.3
bk-2.0.4
bk-2.0.4b
bk-2.1.2
bk-2.1.3
bk-3par_merge
bk-3par_merge2
SEE ALSO
bk-changes, bk-log
CATEGORY
Utility