File operations
-
What is the best method for adding new files to a BitKeeper package?
If you are adding a small number of files, the easiest thing to do
is
 |
bk new file
|
If you are creating a new package, and you have an existing set of
files, run:
 |
bk setup new_package
bk import -tplain files new_package
|
which will import all files into the new package.
This method can only be used once, when the package is created.
If you have a large number of files to add to an existing package,
the easiest way is to copy the files into the package, generate a
list of the files, edit the list to make sure there are no
unwanted files (such as object files from an earlier build), and
then create the files from the list.
For example:
| cd new_package |
|
| mkdir new_files |
|
| cd new_files |
|
| cp -rp ~/files_to_import . |
|
| bk sfiles -x . > /tmp/LIST |
|
| vi /tmp/LIST |
# remove any you don't want |
| bk new - < /tmp/LIST |
|
-
What is the best method for deleting files from a BitKeeper package?
The command bk rm file(s) will remove a file(s) from
the BitKeeper package.
Because BitKeeper remembers everything, this actually renames the
file to .del-file.
All future BitKeeper operations ignore the file unless you name it
explicitly, but it still exists in the package and will still be
propagated by resync/pull/push.
If there is a file that you really want to not be in the tree, you
have to do this:
 |
bk gone `bk prs -hr+ -d:KEY: file`
rm file SCCS/s.file
|
The gone command records the fact that the file is really gone and
tells BitKeeper to not complain when it can't find it.
Can I simply do a 'bk ignore deleted/' so that subsequent clones won't get the deleted directory?
The short answer is no.
The most important points to note are:
* bk gone takes a root key as argument,
not
a file name or directory name.
* bk gone does not actually remove a file, it just
informs BitKeeper that the file (which is associated with the
specified root key) is physically deleted.
The lack of a bk command to physically remove a file is
deliberate, we do not want to encourage this action, since it
results in a lack of reproducibility.
-
What does BitKeeper do with file permissions and how can I change them?
BitKeeper preserves all file permissions as they were originally
set in the first established tree, unless you specifically change
them with the bk chmod command.
| |