Questions:
==========

1. How do I jump to a certain point, do some coding and merge this back into the main tree?
2. How can I see what will be send out if i do bk push?
3. I'm on windows and I can't clone, something with rsh not found. What do I do?
4. I'm looking for changesets with revtool, the dates and times are all wrong, what's happening?
5. I'm a scenario lead and have my own repository for the big change I'm making. I want the 'catch-up'
   with the main tree. How do I do that?
6. I'm getting errors on pull that files are in the changeset but not in the repository. What does it
   mean and what can I do to make it go away.
7. When I pull I get the error: 
   path/to/some/file/SCCS/s.somefile.php is edited and modified; unsafe to overwrite. What does that mean?
8. Can I move files from one repository to another?
9. I'm on Windows.  How can I automagically export my repository into my Apache htdocs directory?

Answers:
========

1. How do I jump to a certain point, do some coding and merge this back into the main tree?
-------------------------------------------------------------------------------------------
Suppose changeset 1.156 is in the past and you want to fix things from there.

a.) bk clone -r1.156 ~/bk/main ~/bk/bugfix
This will get you a repository as it was during changeset 1.156 in the bugfix directory

b.) cd ~/bk/bugfix
   
c.) hack hack hack

[time passes, main is ready for bugfix]
   
d.) cd ~/bk/main

e.) bk pull ../bugfix
Get only the bugfixes back into your local main tree. Any conflicts can be resolved now
If you've cloned your main tree from a central one, a bk push will send the bugfix over to
that repository as well

Remarks:
	- why not use clone -l ?


2. How can I see what will be send out/in if i do bk push/pull?
---------------------------------------------------------------

bk changes -L  (list changes which are only in local an not in remote)
bk changes -R  (list changes which are only in remote and not in local)

3. I'm on windows and I can't clone, something with rsh not found. What do I do?
--------------------------------------------------------------------------------
It seems that in the cygwin install, ssh and friends are not included. Here's what 
you can do.
1. Get the webinstaller for cygwin from cygwin.com
2. Fire it up and look for the openssh and openssl package, install them both
3. try it again

4. I'm looking for changesets with revtool, the dates and times are all wrong, what's happening?
------------------------------------------------------------------------------------------------
Because developer groups can consist of people in different timezone all date and timestamps are
in UTC time. 

5. I'm a scenario lead and have my own repository for the big change I'm making. I want the 'catch-up'
   with the main tree. How do I do that?
-----------------------------------------------------------------------------------------------------
The scenario tree you are working in is a child of the actual scenario tree and has a different (higher)
level. For getting changes into the scenario (for example, just before finishing up the scenario and 
putting it up for review) do the following:

a.) bk parent yourname@xaraya.com:/path/to/main-tree
This will set your parent to the main repository
b.) bk pull
This will get the changes from the main tree which you don't have and apply them.
c.) bk parent yourname@xaraya.com:/path/to/scenario-tree

Or perhaps easier:

bk pull yourname@xaraya.com:/path/to/main-tree

This will do all of the above in one go. The parent is only changed for this command.

6. I'm getting errors on pull that files are in the changeset but not in the repository. What does it
   mean and what can I do to make it go away.
-----------------------------------------------------------------------------------------------------
It means that you are pulling files with changes in them but your local copy doesn't have the file 
while it should have a copy. This can be caused by a number of problems, one of which is a bitkeeper
bug (identified on windows version 3.0). Contact you local bitkeeper guru to help you out.

7. When I pull I get the error: 
   path/to/some/file/SCCS/s.somefile.php is edited and modified; unsafe to overwrite. What does that mean?
---------------------------------------------------------------------------------------------------------
This message is a little bit confusing. The file somefile.php is in /path/to/somefile/ and is checked out 
from the repository and modified. Run bk citool to check this file in and then pull again. For a pull to 
automatically resolve differences between the remote repository and your local one, all files need to be
checked in, so bitkeeper knows what changes have been made. If the message says the the file is writable 
but not checked out you can rename it, do a 'bk edit' with the original filename and see if there are 
differences between them. If not, you can safely delete it. If there are differences merge the contents
by hand or run bk fmtool on the two files to merge them.


8. Can I move files from one repository to another?
---------------------------------------------------
Yes, you can, but it is a bit confusing. Maybe it's best explained by an example.
Say you want to move a directory and all its files from the main repository to the modules repository

Thus:
All files below <main_repo>/<path_to_dir>/<dir_to_move> to <modules_repo>/<path_to_dir>/<dir_to_create>

There is a command 'bk mvdir', but this will only work within one repository, so we are going to 'simulate'
the move by copying the files and then removing them in the original repository. The 'bk cp' command however
does only copy 1 file so we need to do something extra to copy multiple files. 

First let's do a copy of 1 file 'test.txt'

Steps:
1. Go to the destination repository and create the directory <modules_repo>/<path_to_dir>/<dir_to_create>
2. Go to the source repository and cd into the directory which contains the file 'test.txt'
3. Issue: bk cp test.txt <modules_repo>/<path_to_dir>/<dir_to_create>/

This will make a copy of the file and 're-create' all changes made to it in the past, you will see that 
happen on the screen. This is necessary, so all file-history of the file is preserved. Once the 'bk cp' action
is done you will have the file in the new repository with all changes registered as deltas on that file.
You can of course repeat the process for several files and commit them to a changeset when you're done.

If you are comfortable with the unix shell (or cygwin for windows users) you can also copy all files at 
once.

Steps:
1. Go to the destination repository and create the directory <dir_to_create>
2. Go to the source repository and cd into the directory which contains the files and directories
3. Issue:
bk sfiles -g | xargs -n1 -i bk cp {} <modules_repo>/<path_to_dir>/<dir_to_create>/{}

Explanation:
'bk sfiles -g' will list all files in the source repository which are under revision control, this list 
gets fed into the xargs command which will in turn run the bk cp command on each file in that list. It does
the same as the example with 1 file, only for all the files in the directory at once.


If the 'bk cp' action is successfull, go into the destination repository and check if all is well:
1. bk -r check -ac
2. bk sane

If not messages are given, you can run 'bk citool' and create a changeset. The copy action is now complete.
To complete the move action go back to the source repository and issue: 'bk rmdir <dir_to_move>'. This will
remove the directory '<dir_to_move>' and all the files in it. 

To make the changes permanent you can issue 'bk push' in both repositories and the move is done. 

9. I'm on Windows.  How can I automagically export my repository into my Apache htdocs directory?
-------------------------------------------------------------------------------------------------
This is possible, if a little complex.  Install your site (including editing 
the config files).  Now we can begin.

Steps:
1. Open a MS-DOS window and cd to your repository
2. Copy config.system.php and config.site.xml from your Apache htdocs folder 
into a temporary location: c:\tmp for example.
3. Copy the batch file below and save it in a convenient place.  Edit the paths 
as required by your BitKeeper/Apache setup.

cls
cd c:\PATH\TO\REPOSITORY
bk export -tplain -vw -ihtml/* xaraya C:\PATH\TO\TEMPORARY\FOLDER
cd C:\PATH\TO\HTDOCS\FOLDER
deltree /Y *
move C:\PATH\TO\TEMPORARY\FOLDER\html\* .\
deltree /y C:\PATH\TO\TEMPORARY\FOLDER
copy C:\tmp\config.site.xml C:\PATH\TO\HTDOCS\FOLDER\var
copy C:\tmp\config.system.php C:\PATH\TO\HTDOCS\FOLDER\var
del C:\PATH\TO\HTDOCS\FOLDER\var\*.dist
cd C:\PATH\TO\REPOSITORY
