cvs diff samples

a part of MarkD's Guide to CVS
Here are some samples from the cvs diff command for some revisions of a file from ACS. You can see the corresponding cvs log for this file.

insert-msg.tcl

Say you wanted to find out what was done to add "anti-spam proofing" that was introduced in revision 1.3 of insert-msg.tcl. The lines preceeded with ">" were added to revision 1.2, and the lines preceeded with "<" were lines that were deleted.
% cvs diff -r1.2 -r1.3 insert-msg.tcl

RCS file: /usr/local/cvsroot/acs/www/bboard/insert-msg.tcl,v
retrieving revision 1.2
retrieving revision 1.3
diff -r1.2 -r1.3
166a167,191
> set selection [ns_db select $db "select the_regexp, scope, message_to_user
> from bboard_bozo_patterns
> where topic = '$QQtopic'"]
> 
> while { [ns_db getrow $db $selection] } {
>     set_variables_after_query
>     if { $scope == "one_line" || $scope == "both" } {
>       # let's check the subject line for this regexp
>       if [regexp -nocase $the_regexp $one_line] {
>           incr exception_count
>           append exception_text "<li>$message_to_user\n"
>           # you can only be a bozo once
>           break 
>       }
>     }
>     if { $scope == "message" || $scope == "both" } {
>       if [regexp -nocase $the_regexp $message] {
>           incr exception_count
>           append exception_text "<li>$message_to_user\n"
>           # you can only be a bozo once
>           break 
>       }
>     }
> }
> 
206,207c231,232
< set id [ad_verify_and_get_user_id]
< if { $id == 0 } {
---
> set user_id [ad_verify_and_get_user_id]
> if { $user_id == 0 } {
212c237,241
< set selection [ns_db 1row $db "select * from users where user_id=$id"]
---
> # for people who are looking for a user's name or email,
> # we need to get this from the users table
> set selection [ns_db 1row $db "select first_names, last_name, email
> from users
> where user_id=$user_id"]
215d243
< 
219,228d246
< 
< # let's add a layer of bogosity to look for bad postings
< 
< # if { [string first "martin tai" [string tolower $message]] != -1 || [string first "martin tai" [string tolower $name]] != -1 } {
< #     # we don't like this guy Martin so we play dead
< #     bboard_pretend_to_be_broken $full_anchor $maintainer_email
< #     return
< # }
< 
< # back to the legit code


markd@badgertronics.com
$Id: cvsdiff-sample.html,v 1.2 1999/12/23 21:49:09 markd Exp $