![]() |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Test drive Thank you for trying BitKeeper! The following demo will walk you through:
You will need to type some commands and run some graphical tools. You will see prompts like this:
The demo was designed to be done in under 30 minutes. Installation In this section you will install the BitKeeper product. If you have not downloaded BitKeeper you should request an evaluation key and download information now. Once you have downloaded the software, continue with the installation directions for your operating system. Unix The image you download is an executable file and your license keys are imbedded in it. In case your browser did not preserve the permissions, do:
Then run the installer:
The default is to run the graphical installer. To run the command-line installer, set the destination directory on the command line:
Windows The image you download is an executable file and your license keys are embedded in it.
Once BitKeeper is successfully installed, open a cmd window to run the demo:
Mac OSX The image you download is an executable file and your license keys are embedded in it. You will need to run the executable from a terminal window. In case your browser did not preserve the permissions, do:
Then run the installer:
When prompted, enter your own password. The default is to run the graphical installer. To run the command-line installer, set the destination directory on the command line:
Cloning a repository Cloning is the term we use to describe the process of getting a personal workspace. Your workspace is your copy of both the source code and the revision history. You browse, modify, and check in changes to your workspace. In the cloning section you will:
Go to a directory or folder of your choice.
This creates a complete copy of the workspace in BK/my_parent. If it doesn't work, you might need to tell BitKeeper about your HTTP proxy, which you can do by
For more information about methods of accessing repositories see the manual page
Try this now and go to the next page after it is completed. Cloning a child Because the demo does not allow you to push changes back to bkbits.net, you need to clone again so that you have a local parent and child. This also demonstrates same file system clones.
You should now have a directory with two subdirectories: my_parent and bk_demo. There is a recorded relationship to the parent repositories. bk_demo knows that it gets updates from and sends updates to my_parent and my_parent knows it gets updates from and sends updates to http://bkdemo.bkbits.net/bk_demo. Using bk revtool There are ways to browse the repository both graphically and via the command line. The following example shows you how to browse a repository and file history using the graphical revision history browser, bk revtool. Repository history is grouped by changesets. A changeset is a grouping of one or more changes to one or more files, and it is what is propagated between BitKeeper repositories. Changesets are stored in a revision controlled file named ChangeSet and can be browsed graphically. To do so:
When in bk revtool, do:
Things to notice:
Repository history
The bottom window contains the comments for the changed files as well as the changeset comments.
The bottom window now contains the comments for all changes from rev 1.111 and 1.114, inclusive.
Things to notice:
Stay in bk revtool; on the next page you'll look at file history. File history
You should be looking at a changeset which has modifications to pass2.c.
Another bk revtool appears; this one displays the history of pass2.c. Revision 1.36 of pass2.c is the delta in the 1.114 changeset. bk revtool is displaying the differences between the revision of interest (1.36) and its parent (1.35). We can now explore this file further.
To see the differences introduced by this delta:
The differences are displayed in the text window. To see side by side differences with all the file context in a new window:
Stay in bk revtool with pass2.c in the title bar; on the next page you'll do some searching. Searching Suppose that you are looking for a particular change in pass2.c. Start by getting an annotated listing by
You should see lines like
tytso 1.1 /* tytso 1.1 * pass2.c --- check directory structure tytso 1.1 *The first field is the user who added that line, the second field is the revision in which that line was added or changed, and the rest is the line content. Suppose that you were trying to track down a bug in symlink handling. You know that the problem has something to do with a function with pass1_check in its name. To find this
That's the one you want. But you remember it being different so you would like to see what it was like before this.
Notice that the highlighted node in the graph is now the one corresponding to the line you just clicked. To see the changes for this revision,
Repeat the search process to find the call to e2fsck_pass1_check_symlink:
Stay in bk revtool; on the next page you'll look at the changeset that added that line. Viewing a changeset You should be on revision 1.34 in the history of pass2.c; if not go click on that. Now that you have found the version of the line you want, you might want more information about what was happening when this change was made. This information can be helpful in tracking down the root cause of a bug.
A new window, labeled Cset Tool, should appear. This window has 4 panes.
Browse around in the changeset viewer. Try clicking the files, moving through diffs, etc.
At this point you should now be familiar with viewing repository and file revision history using bk revtool. If you would like to use command-line tools to browse history, please read the help pages for bk changes and bk log:
Updating your repository Next, you will update your repository using bk pull.
The bk pull command can be used with or without specifying a BitKeeper URL. Using bk pull without a URL argument pulls from the parent. With a URL, BitKeeper pulls from the repository specified by the URL. By default, the parent is the repository from which the current repository was cloned.
It should have told you there was nothing to pull, which is correct; that repository has not changed. Let's go pull from a different repository which does have changes:
You now have learned how to get updates from the parent repository or an alternative repository. Go on to the next page to make your own changes. Making changes In this section you will learn about and become familiar with
Checkouts Before you actually make any changes, it is important to get acquainted with how to check out files in BitKeeper.
Cleaning a directory
Notice the directory is populated with files. Now do:
Notice that the files are now gone. The SCCS directory is where the revision histories for the files in the directory reside. On Windows the SCCS directory is hidden by default.
Checking out
To check out (or get) the files in read-only mode do:
Notice that the directory is now populated. Now check out the files in read/write mode:
Notice that the files are now read/write capable and thus can be modified. To put the repository back in its original state, do:
Checkout Modes
By default, BitKeeper operates in a "clean" checkout mode such that all files must be explicitly checked out. It can also run in other checkout modes: get mode and edit mode. The repositories you have cloned for this demo run in checkout:get mode and consequently all files in the repository are checked out in read-only mode. If you run in checkout:edit mode, all files in the repository are checked out and can be modified. Modifying a file Please do the following modification to recovery.c:
Creating a file Create a new file:
Notice that you did not tell BitKeeper that this file needs to be revision controlled; you'll do that later. Viewing the changes Often it is useful to see what changes have been made that haven't been checked in yet. You can use bk difftool or bk diffs to view differences. Try the command line first; you should see the jread changes:
And to see which files are not yet under BitKeeper control:
Then try the graphical tool:
As with most BitKeeper graphical tools, you can use the "n" key to get to the next diff and the "p" key to get to the previous diff. bk difftool displays the differences between the last rev and the modified versions of the file if run without options and the file argument is a modified file. With no arguments, it shows diffs for all modified files in the current directory.
Checking in changes Checking in files and creating a changeset can be done via the command line or with bk citool, the graphical check-in tool. We recommend using bk citool because it shows the changes made to each file which improves the quality of the comments. Steps for the graphical tool are shown first followed by steps for another file edit and the command-line check-in. Using bk citool:
You have now checked in your changes, added the new file foo.c, and grouped these changes into a changeset. Next you will check in changes using the command line:
To see the changes you've just made:
The history of the recovery.c file is shown in another bk revtool window. You can use bk revtool on files in the same way you can use it on a repository.
Merging changes The next part of the demo will illustrate how to merge conflicts. BK/ProMerge can complete many complicated merges automatically, but there will be times when there are merge conflicts that need to be resolved by a human being. The BitKeeper update process does not apply changes to your repository until they have been merged. Instead, the changes are pulled into a sparse repository called the RESYNC repository. When there are conflicts to merged, the bk pull command tells you that as the last part of the output. In the following section you will learn
Let's go see how that works. Pulling and resolving a conflict When you pull in a conflict that must be merged manually, BitKeeper will automatically run the resolver and will prompt you to resolve the conflicts. Let's pull in a merge conflict:
You should see:
Because bk pull encountered merge conflicts, it runs the resolver, which prompts you to resolve the conflicts. (You can run the resolver manually with the bk resolve command.) The resolver can handle a number of different conflict types, such as content or rename conflicts. Each conflict type has its own resolver "plugin" with a type specific set of commands. In this example, you will be handling a content conflict.
File merge You should see a multi-pane graphical tool. It has 6 panes:
Each conflict that must be resolved by hand highlights the status bar in red. To select a line or block simply click in the upper left or upper right boxes on the line or block that should be in the merged file. So, in the example, you're going to keep the changes you made and complete the merge.
Checkin The file merge tool should have dropped you back into the resolver interface. If you are sure that you want to keep the merged changes you are ready to commit the merge:
If there were more files with conflicts, the resolver would prompt you with the next conflict. Since this is the only conflict, the resolver then brings up citool to allow you a chance to comment the merge changes.
Update the parent What you have done so far is to make local changes and merge in changes from a different repository. You have not yet updated the parent with your changes; they are only in your repository. In this section you will learn
You can see if there are changes in the parent (or remote) repository that aren't in your repository by running
You shouldn't have seen any changes. You can see if there are changes in your local repository that aren't in the parent by running
To update the parent repository, you need to do what is known as pushing, i.e., you push your changes to the parent repository. To see where changes will go, run the bk parent command and then push:
After you push, the parent and your local repository are exactly the same. If you pull or push, nothing should be transferred. Let's see what happens when you try a bk pull:
You should not have received any updates. You have now updated a repository with the changes that you made. Finis Congratulations! You have successfully run through some of the basic and some of the more complex BitKeeper operations. You've seen how to get views of the repository and its files via the command line and via the graphical tools. You have made modifications to a file, added new files, checked in those files, and created a changeset. And finally, you've run through a merge with conflicts that needed to be resolved by hand. You might want to delete the BK directory you made along with all the demo repositories. For more information about BitKeeper commands, try one of the following:
If you need further assistance, you can find it at support@bitmover.com. A next step in learning about BitKeeper is to try it on your own data. If you would like to talk to a representative about doing a conversion of your current tool's data, please send mail to sales@bitmover.com. Thank you for trying BitKeeper and we hope you liked your tour.
|