NAME
bk csetprune − shrink a repository by removing
files
SYNOPSIS
bk csetprune [options] − <
keylist
DESCRIPTION
The csetprune command is used to prune certain files
from the repository. These files are removed in a way which
is permanent, i.e., the prune cannot be undone.
The command operates on a list of file keys (sometimes called BitKeeper inodes). Each file associated with a key is removed from the repository and from all changesets in the ChangeSet file. If a changeset becomes empty as a result of the key removal, then that changeset is removed from the ChangeSet file history. If a removed changeset had a tag, the tag is moved to the closest non-removed ancestor in the ChangeSet file. If that ancestor was already tagged with the same tag, the duplicate tag is discarded.
After all files have been removed, the identity of the ChangeSet file is changed (using bk newroot) and the remaining files are “reparented” to the new ChangeSet file.
OPTIONS
−k16hexDigits
Specify the 16hexDigits used in a repository root key. This is needed when doing a csetprunes over time on same key set and wanting the resulting repository to communicate with a repository created by an earlier csetprune.
−Ggonefile
This will prune out the gone file and put the contents of
file passed in with -G as the initial content of a new gone
file. If there are additional files and deltas missing, a
delta to the new gone file will be automatically generated
and committed.
−S
−−standalone Just run csetprune on the
current component. This has no effect in a traditional
standalone repository, but in a nested collection, processes
just the current component and not the entire nested
collection.
−−tag−csets Alter the symbol structure
to remove duplicates and move the symbols directly onto the
tagged cset. Use this if you do not need to csetprune more
than one repository such that the resulting repositories to
communicate via push, pull or changes. With this option, the
internal symbol graph structure is streamlined.
GENERATING
KEYS
The bk log command may be used to generate the list
of keys. When generating keys, it is important to realize
that looking in a particular subdirectory is likely to miss
some of the files that you may want to remove. The files may
have been moved to another directory or they may have been
removed (which is really just a move to the
BitKeeper/deleted subdirectory).
The following command will generate a list of keys for all files originally created in the junk subdirectory, including all deleted and/or moved files:
bk -A log -hr+ -nd:ROOTKEY: | grep ’|junk/’
EXAMPLE
Suppose there is a repository which has two major
subsections, called docs and src respectively.
The repository has grown to be too large and the goal is to
split it in two. The process for doing so would be to
(1) Make sure all users have pushed their changes into the
main repository. Changes made after the split will have to
exported as a traditional patch and imported, which loses
the checkin comments.
(2) Clone the repository twice, once for each of docs
and src.
(3) In each new repository, strip out the files which will
be in the other repository.
Commands which will do this:
bk clone master
src
bk clone master docs
# Remove the docs files from the src repository
cd src
bk -A log -hr+ -nd:ROOTKEY: | grep ’|docs/’ | bk
csetprune
# Remove the src files from the docs repository
cd ../docs
bk -A log -hr+ -nd:ROOTKEY: | grep ’|src/’ | bk
csetprune
SEE ALSO
bk-newroot, bk-log, bk-gfiles
CATEGORY
Admin