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 
    
Reporting with Scripting
Information about files or sets of files can be found using bk prs, a command used to extract revision history and or metadata from a file or set of files. There are many options to prs, making it a powerful query language for the BitKeeper database which is your source base. The default behavior is to print a summary of each revision to each of the specified files. There are options to restrict the set if revisions to print, a very commonly used one is -r+ which restricts the set to the most recent revision.

With no options specified, prs output defaults to giving information on all revisions of all files under BitKeeper control in the present directory. The filename and range of revisions is listed first, offset by === characters. Below that line, for each revision prs lists: revision number, revision date and time, user who made that revision, what the relative path from root of repository is to that file, the comments that go with that revision, and any renames that have occurred, if appropriate. Revision information is repeated from most recent to oldest, separated by a a line of ---\characters. Once the oldest revision information is listed, then the sequence will repeat with the next file in the directory.

Output Format
The bk prs command has a default output format which can be overridden. There are many different pieces of information in a BitKeeper file and bk prs can extract most of them. To extract specific information, a dspec (data specification) string must be provided and should contain keywords, surrounded by colons. bk prs will expand each of these keywords in the output it produces.

To specify a TAB character in the output, use \t; to specify a NEWLINE in the output, use \n; An example dspec which prints the file name (s.file) and the revision number is

bk prs -d':SFILE: :REV:\n' file

In almost all cases, a trailing newline is not provided by any of the variables and one should be provided as needed. The list of variables which currently provide one are: COMMENTS, PATH, DEFAULT, SYMBOLS.

If a multi-line variable is printed as one line, i.e., without $each() (see below) providing a prefix and/or a suffix, then the lines are separated by spaces. The list of variables with this behavior is: C, GB, FD.

Conditional Output
The dspec can produce output conditionally. The following will print the default output format for each revision made by lm:

bk prs -d'$if(:P:=lm){:DEFAULT:}' file


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

© 1997-2005, BitMover, Inc.