previous | next
 
home  |  search  |  contact  
 
 
 Introduction 
 BitKeeper Concepts  
 Getting Started  
 Advanced Operations 
 Advanced Topics 
 Reporting and Data Mining  
      - File Level 
        . File State Information  
        . File revision history 
        . File Contents 
      - Project Level 
        . Viewing Project History 
        . Viewing ChangeSet Contents 
        . Viewing Tagged ChangeSets 
        . Command History 
      - Debugging with BitKeeper 
        . Build Bugs 
        . Functionality Bugs 
      - Code Reviews 
        . Queue 
        . Process 
      - Reporting with Scripting 
      - BK/Web 
 Appendix A: Installation 
 Appendix B: Administration 
 Site Map 
    
File Contents
Contents of a single revision

To view contents of a single revision of a file you may use bk get to get any revision of a file. If the revision wanted is not known, bk prs may be used to get a listing of each file revision with revision comments.

bk prs file
bk get -r
rev file

File content comparisons (one file)

There are two methods to do file content comparisons: via the GUI tools or via the command line.

To do file content comparisons via the GUI tools, use bk difftool. Differences between any two revisions of a file can be viewed, including the latest modified but not yet checked in version. It's also possible to compare files in different repositories with difftool. To see the differences between the latest modified version of a file and the latest checked in version of the file, use:

bk difftool file

To see the differences between the modified version of a file and another revision:

bk difftool -rrev file

To see the differences between any two specific revisions of a file:

bk difftool -rrev1 -rrev2

To see the differences between a file in one repository and a file in a different repository:

bk difftool /somepath/file1 /someotherpath/file2

To do file content comparisons via the command line, use bk diffs. Differences between the modified version of a file with the last checked in revision of that file, between any two revisions of a file in a repository, or between a specific revision and its preceding revision can be displayed. There is also the ability to do side-by-side diffs as well as author, date, and/or revision annotations if desired. To view the differences between a modified file and the last checked in version of that file, use:

bk diffs file

To view the differences between a modified file and any previous version of that file:

bk diffs -rrev file

To view the differences between any two revisions of a file:

bk diffs -rrev1..rev2 file

To view the differences between a specific revision and its preceding revision:

bk diffs -Rrev file

There is also the ability to do side-by-side diffs as well as author, date, and/or revision annotations if desired. To do that use the options shown below individually or in combination to produce the desired output.

To do side-by-side diffs:

bk diffs -s

To prefix lines with author annotations:

bk diffs -U

To prefix lines with the revision date annotations:

bk diffs -D

To prefix files with revision numbers:

bk diffs -M

As an example, suppose a side-by-side view of differences of revision 1.5 and 1.14 of file foo.c with author and date annotations is desired. To accomplish this the following command could be issued:

bk diffs -sDU -r1.5..1.14 foo.c

File content comparisons (all files in a directory or repository)

Sometimes it is desired to see all the file changes made in a directory or repository since the last time the files were checked out.

To view all differences of all modified files in one directory with the corresponding last checked in files (sometimes this output is very long so piping to more or less may be useful), use:

bk diffs | more

To view all differences of all modified files in a repository with the corresponding last checked in files (sometimes this output is very long so piping to more or less may be useful):

bk -r diffs | more


Home    Company    Products    How to Buy    Downloads    Contact Us    Documentation    Support    Site Map

© 1997-2005, BitMover, Inc.