package VCP::Dest::revml ; =head1 NAME VCP::Dest::revml - Outputs versioned files to a revml file =head1 SYNOPSIS revml:[<output-file>] revml:[<output-file>] --dtd <revml.dtd> revml:[<output-file>] --version <version> revml:[<output-file>] --compress revml:[<output-file>] --no-indent =head1 DESCRIPTION =head1 OPTIONS =item --dtd --dtd=revml.dtd --version=0.33 The --dtd (or --version) option causes the output to be checked against a particular version of revml. This does I<not> cause output to be in that version, but makes sure that output is compliant with that version. =item --compress Generate a gzipped revml file as output. Requires gzip be installed on the machine. If the output filename ends in ".gz", the output will be compressed even if the --compress flag isn't present. =item --no-indent Makes the revml output with all the start tags flush left rather than indented to indicate the tree structure. =back =head1 EXTERNAL METHODS =over =cut use VCP::Logger qw( pr_doing ); use VCP::Utils qw( start_dir_rel2abs ); BEGIN { ## Beginning vcpers might try running a command like "vcp" just ## to see what happens. Since RevML is not required for most ## vcp uses and XML::Parser requires a C compiler, vcp is often ## distributed without XML::Parser, so this message is to help ## steer hapless new users to the help system if the XML output ## modules are also not found. ## The exit(1) is to avoid untidy and scary ## "compilation failed in BEGIN" messages pr( <<TOHERE ), exit 1 unless eval "require RevML::Writer"; RevML::Writer is not installed or loading properly on this system and it is required to write RevML files. If writing RevML files is not what you want to do, try vcp help TOHERE } use strict ; use Carp ; use Digest::MD5 ; use Fcntl ; use File::Basename; use MIME::Base64 ; use RevML::Doctype ; use RevML::Writer ; use Symbol ; use UNIVERSAL qw( isa ) ; use VCP::Debug qw( :debug ) ; use VCP::Logger qw( lg ); use VCP::Rev qw( iso8601format ); use VCP::Utils qw( shell_quote empty ); use Text::Diff ; use vars qw( $VERSION ) ; $VERSION = 0.1 ; use base qw( VCP::Dest VCP::Utils::revml ); use fields ( 'DTD_OPTION', ## The --dtd or --version flag from the command line 'COMPRESS', ## flag indicating gzip'd compressed output 'DOCTYPE', ## revml doc type 'OUT_FH', ## The handle of the output file 'WRITER', ## The XML::AutoWriter instance write with 'SEEN_REV', ## Whether we've seen our first revision or not. 'NO_INDENT', ## output all flush left, not indented to indicate tree structure ) ; =item new Creates a new instance. The only parameter is '-dtd', which overrides the default DTD found by searching for modules matching RevML::DTD:v*.pm. Attempts to create the output file if one is specified. =cut sub new { my $class = shift ; $class = ref $class || $class ; my VCP::Dest::revml $self = $class->SUPER::new( @_ ) ; my ( $spec, $options ) = @_ ; $self->parse_revml_repo_spec( $spec ) unless empty $spec; $self->parse_options( $options ); return $self; } sub options_spec { my VCP::Dest::revml $self = shift ; return ( $self->SUPER::options_spec, 'dtd|version=s' => \$self->{DTD_OPTION}, "compress" => \$self->{COMPRESS}, "no-indent" => \$self->{NO_INDENT}, ); } sub init { my VCP::Dest::revml $self = shift ; $self->head_revs->open_db; $self->{DOCTYPE} = RevML::Doctype->new( $self->{DTD_OPTION} ); my $file_name = $self->repo_filespec; $file_name = "-" if empty $file_name; $file_name = start_dir_rel2abs $file_name unless $file_name eq "-"; lg "revml file name is ", $file_name; # always un-compress if filename ends in ".gz" my $gzip; if ( $^O =~ /Win32/ ) { $self->{COMPRESS} = 1 if $file_name =~ /\.gz$/i ; $gzip = "gzip.exe"; } else { $self->{COMPRESS} = 1 if $file_name =~ /\.gz$/ ; $gzip = "gzip"; } if ( $file_name eq '-' ) { if( $self->{COMPRESS} ) { require Symbol ; $self->{OUT_FH} = Symbol::gensym ; open( $self->{OUT_FH}, "| $gzip" ) or die "$!: | gzip" ; } else { $self->{OUT_FH} = \*STDOUT ; } ## TODO: Check OUT_FH for writability when it's set to STDOUT } else { require Symbol ; $self->{OUT_FH} = Symbol::gensym ; ## TODO: Provide a '-f' force option if( $self->{COMPRESS} ) { my $out_name = shell_quote $file_name; open( $self->{OUT_FH}, "| $gzip > $out_name" ) or die "$!: | gzip > $file_name" ; } else { open( $self->{OUT_FH}, ">$file_name" ) or die "$!: '$file_name'" ; } } ## BUG: Can't undo this AFAIK, so we're permanently altering STDOUT ## if $out_name eq '-'. binmode $self->{OUT_FH}; $self->writer( RevML::Writer->new( DOCTYPE => $self->{DOCTYPE}, OUTPUT => $self->{OUT_FH}, ) ); return $self ; } =item ui_set_revml_repo_spec set the repo_spec, but die if no good. this should be called from a ui handler that will handle exceptions. =cut sub ui_set_revml_repo_spec { my $self = shift ; $self->parse_revml_repo_spec( @_ ); my $file = $self->repo_filespec; die "Error: '-' signifies standard output, not a file name.\n" if $file eq '-'; $file = start_dir_rel2abs $file ; die "Error: '$file' is a directory.\n" if -d $file; if( -e $file ) { die "Warning: '$file' exists and is writable.\n" if -w $file; die "Error: '$file' exists, but is not writable!\n"; } my $dirname = dirname( $file ); die "Error: directory '$dirname' not found!\n" unless -d $dirname; } sub _emit_characters { my ( $w, $buf ) = @_ ; $w->setDataMode( 0 ) ; ## Note that we don't let XML munge \r to be \n!! while ( $$buf =~ m{\G(?: ( [\x00-\x08\x0b-\x1f\x7f-\xff]) | ([^\x00-\x08\x0b-\x1f\x7f-\xff]*) )}gx ) { if ( defined $1 ) { $w->char( "", code => sprintf( "0x%02x", ord $1 ) ) ; } else { $w->characters( $2 ) ; } } } sub handle_rev { my VCP::Dest::revml $self = shift ; my VCP::Rev $r ; ( $r ) = @_ ; my $w = $self->writer ; if ( ! $self->{SEEN_REV} ) { ## We don't write any XML until the first rev arrives, so an empty ## RevML input doc (with root node but no revs) results in no output. ## This is more for non-RevML inputs, so that an export that selects ## no new revisions generates no output, which is easy to test for. $w->setDataMode( 1 ) unless $self->{NO_INDENT}; $w->xmlDecl ; my $h = $self->header ; ## VCP::Source::revml passes through the original date. Other sources ## don't. $w->time( defined $h->{time} ? iso8601format $h->{time} : iso8601format gmtime ) ; $w->rep_type( $h->{rep_type} ) ; $w->rep_desc( $h->{rep_desc} ) ; $w->comment( $h->{comment} ) if defined $h->{comment}; $w->rev_root( $h->{rev_root} ) ; } $self->{SEEN_REV} = 1; ## TODO: get rid of revs that aren't needed. We should only need ## the most recent rev with a work path on each branch. my $fn = $r->name ; my $is_base_rev = $r->is_base_rev ; ## type and rev_id are not provided for VSS deletes debug "emitting revml for ", $r->as_string if debugging; eval { $w->start_rev( id => $r->id ); $w->name( $fn ); $w->source_name( $r->source_name ); $w->source_filebranch_id( $r->source_filebranch_id ); $w->source_repo_id( $r->source_repo_id ); $w->type( $r->type ) if defined $r->type ; $w->p4_info( $r->p4_info ) if defined $r->p4_info ; $w->cvs_info( $r->cvs_info ) if defined $r->cvs_info ; if( defined $r->branch_id || defined $r->source_branch_id ) { $w->branch_id( defined $r->branch_id ? $r->branch_id : () ); $w->source_branch_id( defined $r->source_branch_id ? $r->source_branch_id : () ); } $w->rev_id( $r->rev_id ) if defined $r->rev_id ; $w->source_rev_id( $r->source_rev_id ) if defined $r->source_rev_id ; if( defined $r->change_id || defined $r->source_change_id ) { $w->change_id( defined $r->change_id ? $r->change_id : () ); $w->source_change_id( defined $r->source_change_id ? $r->source_change_id : () ); } $w->time( iso8601format $r->time ) if defined $r->time ; $w->mod_time( iso8601format $r->mod_time ) if defined $r->mod_time ; $w->user_id( $r->user_id ) if defined $r->user_id; ## Sorted for readability & testability $w->label( $_ ) for sort $r->labels ; unless ( empty $r->comment ) { $w->start_comment ; my $c = $r->comment ; _emit_characters( $w, \$c ) ; $w->end_comment ; $w->setDataMode( 1 ) unless $self->{NO_INDENT}; } $w->previous_id( $r->previous_id ) if defined $r->previous_id; my $convert_crs = $^O =~ /Win32/ && ( $r->type || "" ) eq "text" ; my $digestion ; my $close_it ; my $cp; ( $cp ) = VCP::Revs->fetch_files( $r ) if $is_base_rev || $r->action eq "add" || $r->action eq "edit" || $r->action eq "branch"; if ( $is_base_rev ) { sysopen( F, $cp, O_RDONLY ) or die "$!: $cp\n" ; binmode F ; $digestion = 1 ; $close_it = 1 ; } elsif ( $r->is_placeholder_rev ) { $w->placeholder() ; $digestion = 0; } elsif ( $r->action eq 'delete' ) { $w->delete() ; } else { sysopen( F, $cp, O_RDONLY ) or die "$!: $cp\n" ; ## need to binmode it so ^Z can pass through, need to do \r and ## \r\n -> \n conversion ourselves. binmode F ; $close_it = 1 ; my $buf ; my $read ; my $total_char_count = 0 ; my $bin_char_count = 0 ; while ( 1 ) { $read = sysread( F, $buf, 100_000 ) ; die "$! reading $cp\n" unless defined $read ; last unless $read ; $bin_char_count += $buf =~ tr/\x00-\x08\x0b-\x1f\x7f-\xff// ; $total_char_count += length $buf ; } ; sysseek( F, 0, 0 ) or die "$! seeking on $cp\n" ; $buf = '' unless $read ; ## base64 generate 77 chars (including the newline) for every 57 chars ## of input. A '<char code="0x01" />' element is 20 chars. my $legal_xml_char_count = $total_char_count - $bin_char_count; ## TODO: calculate the diff no matter what in to a temp file, ## keeping stats on how to encode it (none vs. base64). ## If encoding it would be shorter than the encoded content of ## the new rev, use it. This should be safe now that we're using ## all-Perl diff & patch (which don't mind NUL, for instance). ## if both are eaual, use the more human readable format ("none") my $encoding = ( $legal_xml_char_count + $bin_char_count * 20 ) <= $total_char_count * 77/57 ? "none" : "base64"; my $pr = $r->previous; $pr = $pr->previous if $pr && ( $pr->action || "" ) eq "placeholder"; if ( $pr ## Can't delta unless we have $pr && defined $pr->work_path && $encoding eq "none" ## base64, should't delta. ) { $w->start_delta( type => 'diff-u', encoding => 'none' ) ; my $old_cp = $pr->work_path ; die "no old work path for '", $pr->id, "'\n" if empty $old_cp ; die "old work path '$old_cp' not found for '", $pr->id, "'\n" unless -f $old_cp ; ## TODO: Include entire contents if diff is larger than the contents. ## Accumulate a bunch of output so that characters can make a ## knowledgable CDATA vs <& escaping decision. my @output ; my $outlen = 0 ; my $delete_nl ; ## TODO: Write a "minimal" diff output handler that doesn't ## emit any lines from $old_cp, since they are redundant. debug "diffing $old_cp $cp" if debugging; diff $old_cp, $cp, { ## Not passing file names, so no filename header. STYLE => "VCP::DiffFormat", OUTPUT => sub { push @output, $_[0] ; ## Assume no lines split between \r and \n because ## diff() splits based on lines, so we can just ## do a simple conversion here. $output[-1] =~ s/\r\n|\r/\n/g if $convert_crs ; $outlen += length $_[0] ; return unless $outlen > 100_000 ; _emit_characters( $w, \join "", splice @output ) ; }, } ; _emit_characters( $w, \join "", splice @output ) if $outlen ; $w->end_delta ; $w->setDataMode( 1 ) unless $self->{NO_INDENT}; } else { ## Full content, no delta. $w->start_content( encoding => $encoding ) ; my $delete_nl ; while () { ## Odd chunk size is because base64 is most concise with ## chunk sizes a multiple of 57 bytes long. $read = sysread( F, $buf, 57_000 ) ; die "$! reading $cp\n" unless defined $read ; last unless $read ; if ( $convert_crs ) { substr( $buf, 0, 1 ) = "" if $delete_nl && substr( $buf, 0, 1 ) eq "\n" ; $delete_nl = substr( $buf, -1 ) eq "\n" ; $buf =~ s/(\r\n|\r)/\n/g ; ## ouch, that's gotta hurt. } if ( $encoding eq "none" ) { _emit_characters( $w, \$buf ) ; } else { $w->characters( encode_base64( $buf ) ) ; } } $w->end_content ; $w->setDataMode( 1 ) unless $self->{NO_INDENT}; } ; $digestion = 1 ; } if ( $digestion ) { ## TODO: See if this should be seek or sysseek. sysseek F, 0, 0 or die "$!: $cp" ; my $d= Digest::MD5->new ; ## gotta do this by hand, since it's in binmode and we want ## to handle ^Z and lone \r's. my $delete_nl ; my $read ; my $buf ; while () { $read = sysread( F, $buf, 10_000 ) ; die "$! reading $cp\n" unless defined $read ; last unless $read ; if ( $convert_crs ) { substr( $buf, 0, 1 ) = "" if $delete_nl && substr( $buf, 0, 1 ) eq "\n" ; $delete_nl = substr( $buf, -1 ) eq "\n" ; $buf =~ s/(\r\n|\r)/\n/g ; ## ouch, that's gotta hurt. } $d->add( $buf ) ; } $d->addfile( \*F ) ; $w->digest( $d->b64digest, type => 'MD5', encoding => 'base64' ) ; } if ( $close_it ) { close F ; } $w->end_rev ; 1; } or die "$@ while writing ", defined $r ? $r->as_string : "UNDEF $r!!"; ## This frees up any previous revs that are no longer needed. We only ## need previous revs if there is no file associated with this rev. if ( defined $r->work_path && ( $r->action || "" ) ne "placeholder" ) { $r->previous( undef ); } pr_doing; $self->head_revs->set( [ $r->source_repo_id, $r->source_filebranch_id ], $r->source_rev_id ); } sub handle_footer { my VCP::Dest::revml $self = shift ; my ( $footer ) = @_ ; $self->writer->endAllTags() if $self->{SEEN_REV}; $self->{SEEN_REV} = 0; $self->SUPER::handle_footer; return ; } sub writer { my VCP::Dest::revml $self = shift ; $self->{WRITER} = shift if @_ ; return $self->{WRITER} ; } =back =head1 AUTHOR Barrie Slaymaker <barries@slaysys.com> =head1 COPYRIGHT Copyright (c) 2000, 2001, 2002 Perforce Software, Inc. All rights reserved. See L<VCP::License|VCP::License> (C<vcp help license>) for the terms of use. =cut 1
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#68 | 4515 | Barrie Slaymaker | - VCP::*::revml supports <release_id> | ||
#67 | 4507 | Barrie Slaymaker |
- RevML: - added <action>, removed <delete>, <placeholder> and <move> - added <from_id> for clones (and eventually merge actions) - Simplified DTD (can't branch DTD based on which action any more) - VCP::Source::cvs, VCP::Filter::changesets and VCP::Dest::p4 support from_id in <action>clone</action> records - VCP::Dest::perl_data added - VCP::Rev::action() "branch" added, no more undefined action strings - "placeholder" action removed |
||
#66 | 4496 | Barrie Slaymaker | - minor POD cleanups to prevent nags when building VCP::Help | ||
#65 | 4154 | Barrie Slaymaker | - dist/vcp.exe passes almost all tests | ||
#64 | 4021 | Barrie Slaymaker |
- Remove all phashes and all base & fields pragmas - Work around SWASHGET error |
||
#63 | 4012 | Barrie Slaymaker | - Remove dependance on pseudohashes (deprecated Perl feature) | ||
#62 | 3970 | Barrie Slaymaker |
- VCP::Source handles rev queing, uses disk to reduce RAM - Lots of other fixes |
||
#61 | 3930 | Barrie Slaymaker |
- VCP::Source::cvs and VCP::Dest::p4 handle cloning deletes - "placeholder" actions and is_placeholder_rev() deprecated in favor of is_branch_rev() and is_clone_rev(). - Misc cleanups and minor bugfixes |
||
#60 | 3908 | Barrie Slaymaker | - Debugging cleanups | ||
#59 | 3852 | Barrie Slaymaker | - VCP::Dest::revml detects empty filename BUGs | ||
#58 | 3850 | Barrie Slaymaker | - No longer stores all revs in memory | ||
#57 | 3813 | Barrie Slaymaker | - VCP::Rev::previous() is no more | ||
#56 | 3812 | Barrie Slaymaker | - VCP::Dest::* no longer need VCP::Rev->previous() | ||
#55 | 3811 | Barrie Slaymaker | - fetch_*() and get_rev() renamed get_source_file() | ||
#54 | 3805 | Barrie Slaymaker | - VCP::Revs::fetch_files() removed | ||
#53 | 3800 | Barrie Slaymaker | - <branches> removed from all code | ||
#52 | 3706 | Barrie Slaymaker | - VCP gives some indication of output progress (need more) | ||
#51 | 3532 | John Fetkovich |
changed File::Spec->rel2abs( blah, start_dir ) to start_dir_rel2abs blah everywhere. which does the same thing and is defined in VCP::Utils |
||
#50 | 3519 | John Fetkovich | fix warning | ||
#49 | 3501 | John Fetkovich | added ui_set_revml_repo_spec, and caller in the stml file | ||
#48 | 3489 | Barrie Slaymaker | - Document options emitted to .vcp files. | ||
#47 | 3460 | Barrie Slaymaker |
- Revamp Plugin/Source/Dest hierarchy to allow for reguritating options in to .vcp files |
||
#46 | 3430 | Barrie Slaymaker |
- Update the XML escaping heuristic - Add --no-encoding option to prevent base64 encoding of binary data (in case your data isn't all that binary) |
||
#45 | 3414 | Barrie Slaymaker |
- allow NUL characters to occur in text files, our diff and patch routines are NUL clean. |
||
#44 | 3380 | John Fetkovich |
bug fix: do rel2abs on file_name only AFTER checking file is not STDOUT. |
||
#43 | 3377 | John Fetkovich | bug fixes for weird input | ||
#42 | 3376 | John Fetkovich | small changes | ||
#41 | 3331 | John Fetkovich |
Small change in source revml state machine. split 'sub init' from 'sub new' in Source/revml.pm and Dest/revml.pm |
||
#40 | 3284 | John Fetkovich |
'sub new' constructor in Source and Dest p4.pm fixed so parse_p4_repo_spec only called when a $spec is provided to the constructor. parse_p4_repo_spec now also sets the repo_id. parse_repo_spec (TODO item) no longer returns a hash value of the values parsed, it only sets fields in $self. Fixed a few places where that return hash was used. |
||
#39 | 3164 | Barrie Slaymaker | Fix overzealous use of shell_qoute and clean up code. | ||
#38 | 3155 | Barrie Slaymaker |
Convert to logging using VCP::Logger to reduce stdout/err spew. Simplify & speed up debugging quite a bit. Provide more verbose information in logs. Print to STDERR progress reports to keep users from wondering what's going on. Breaks test; halfway through upgrading run3() to an inline function for speed and for VCP specific features. |
||
#37 | 3133 | Barrie Slaymaker |
Make destinations call back to sources to check out files to simplify the architecture (is_metadata_only() no longer needed) and make it more optimizable (checkouts can be batched). |
||
#36 | 3115 | Barrie Slaymaker |
Move sorting function to the new VCP::Filter::sort; it's for testing and reporting only and the code was bloating VCP::Dest and limiting VCP::Rev and VCP::Dest optimizations. Breaks test suite in minor way. |
||
#35 | 3008 | John Fetkovich |
make state database files go under vcp_state in the program start directory (start_dir) instead of start_dir itself. Also escape periods (.) from the database directory as well as the characters already escaped. |
||
#34 | 2972 | Barrie Slaymaker | Interim checkin | ||
#33 | 2931 | John Fetkovich | added empty() calls | ||
#32 | 2926 | John Fetkovich |
remove --state-location switch add --db-dir and --repo-id switches build state location from concatenation of those two. |
||
#31 | 2838 | John Fetkovich | Use parse_options rather than using Getopt::Long directly. | ||
#30 | 2802 | John Fetkovich |
Added a source_repo_id to each revision, and repo_id to each Source and Dest. The repo_ids include repository type (cvs,p4,revml,vss,...) and the repo_server fields. Changed the $self->...->set() and $self->...->get() lines in VCP::Dest::* to pass in a conglomerated key value, by passing in the key as an ARRAY ref. Also various restructuring in VCP::DB.pm, VCP::DB_file.pm and VCP::DB_file::sdbm.pm related to this change. |
||
#29 | 2774 | Barrie Slaymaker | Update HeadRevDB on submit/commit/write | ||
#28 | 2768 | John Fetkovich |
Allow revml to be output in non-indented form with --no-indent option on dest::revml |
||
#27 | 2764 | John Fetkovich |
add --compress switch to dest::revml add --uncompress switch to source::revml use gzip to compress/uncompress revml files |
||
#26 | 2743 | John Fetkovich |
Add fields to vcp: source_name, source_filebranch_id, source_branch_id, source_rev_id, source_change_id 1. Alter revml.dtd to include the fields 2. Alter bin/gentrevml to emit legal RevML 3. Extend VCP::Rev to have the fields 4. Extend VCP::{Source,Dest}::revml to read/write the fields (VCP::Dest::revml should die() if VCP tries to emit illegal RevML) 5. Extend VCP::{Source,Dest}::{cvs,p4} to read the fields 7. Get all tests through t/91*.t to pass except those that rely on ch_4 labels |
||
#25 | 2245 | Barrie Slaymaker | cvs -r (re)implemented for direct reads, passes all cvs-only tests | ||
#24 | 2059 | Barrie Slaymaker | Support for branching in p4->p4 added | ||
#23 | 2051 | Barrie Slaymaker | Enable p4_branch_spec to be carried through revml->revml. | ||
#22 | 2042 | Barrie Slaymaker | Basic source::p4 branching support | ||
#21 | 2017 | Barrie Slaymaker |
Interim checkin of id=/base_version_id for revml: and branch_diagram: |
||
#20 | 2015 | Barrie Slaymaker | submit changes | ||
#19 | 2014 | Barrie Slaymaker |
Give helpful error messages if the vcp command can't read/write RevML due to a missing required module. |
||
#18 | 2009 | Barrie Slaymaker |
lots of fixes, improve core support for branches and VCP::Source::cvs now supports branches. |
||
#17 | 1998 | Barrie Slaymaker | Initial, revml and core VCP support for branches | ||
#16 | 1850 | Barrie Slaymaker | Add "emitting revml for" debugging msg | ||
#15 | 1809 | Barrie Slaymaker | VCP::Patch should ignore lineends | ||
#14 | 1367 | Barrie Slaymaker | lots of docco updates | ||
#13 | 1358 | Barrie Slaymaker | Win32 changes | ||
#12 | 1174 | Barrie Slaymaker | Add and use VCP::DiffFormat | ||
#11 | 1171 | Barrie Slaymaker | Switch to using Text::Diff | ||
#10 | 1055 | Barrie Slaymaker |
add sorting, revamp test suite, misc cleanup. Dest/revml is not portable off my system yet (need to release ...::Diff) |
||
#9 | 695 | Barrie Slaymaker |
Cleaned up support for binary files in VCP::Dest::revml and altered test suite to deal with it better. Added some thoughts to the TODO file. |
||
#8 | 628 | Barrie Slaymaker | Cleaned up POD in bin/vcp, added BSD-style license. | ||
#7 | 609 | Barrie Slaymaker |
Add a file to the test procedure that it alternately added and deleted (file is named "readd"). Fixed all destinations to handle that. |
||
#6 | 608 | Barrie Slaymaker |
Lots of changes to get vcp to install better, now up to 0.066. Many thanks to Matthew Attaway for testing & suggestions. |
||
#5 | 480 | Barrie Slaymaker |
0.06 Wed Dec 20 23:19:15 EST 2000 - bin/vcp: Added --versions, which loads all modules and checks them for a $VERSION and print the results out. This should help with diagnosing out-of-sync modules. - Added $VERSION vars to a few modules :-). Forgot to increment any $VERSION strings. - VCP::Dest::cvs: The directory "deeply" was not being `cvs add`ed on paths like "a/deeply/nested/file", assuming "deeply" had no files in it. - VCP::Dest::revml: fixed a bug that was causing files with a lot of linefeeds to be emitted in base64 instead of deltaed. This means most text files. - Various minor cleanups of diagnostics and error messages, including exposing "Can't locate Foo.pm" when a VCP::Source or VCP::Dest module depends on a module that's not installed, as reported by Jeff Anton. |
||
#4 | 478 | Barrie Slaymaker |
0.05 Mon Dec 18 07:27:53 EST 2000 - Use `p4 labels //...@label` command as per Rober Cowham's suggestion, with the '-s' flag recommended by Christopher Siewald and Amaury.FORGEOTDARC@atsm.fr. Though it's actually something like vcp: running /usr/bin/p4 -u safari -c safari -p localhost:5666 -s files //.../NtLkly //...@compiler_a3 //.../NtLkly //...@compiler_may3 and so //on //for 50 parameters to get the speed up. I use the //.../NtLkly "file" as //a separator between the lists of files in various //revisions. Hope nobody has any files named that :-). What I should do is choose a random label that doesn't occur in the labels list, I guess. - VCP::Source::revml and VCP::Dest::revml are now binary, control code, and "hibit ASCII" (I know, that's an oxymoron) clean. The <comment>, <delta>, and <content> elements now escape anything other than tab, line feed, space, or printable chars (32 <= c <= ASCII 126) using a tag like '<char code="0x09">'. The test suite tests all this. Filenames should also be escaped this way, but I didn't get to that. - The decision whether to do deltas or encode the content in base64 is now based on how many characters would need to be escaped. - We now depend on the users' diff program to have a "-a" option to force it to diff even if the files look binary to it. I need to use Diff.pm and adapt it for use on binary data. - VCP::Dest::cvs now makes sure that no two consecutive revisions of the same file have the same mod_time. VCP::Source::p4 got so fast at pulling revisions from the repositories the test suite sets up that CVS was not noticing that files had changed. - VCP::Plugin now allows you to set a list of acceptable result codes, since we now use p4 in ways that make it return non-zero result codes. - VCP::Revs now croaks if you try to add two entries of the same VCP::Rev (ie matching filename and rev_id). - The <type> tag is now limited to "text" or "binary", and is meant to pass that level of info between foreign repositories. - The <p4_info> on each file now carries the one line p4 description of the file so that p4->p4 transferes can pick out the more detailed info. VCP::Source::p4, VCP::Dest::p4 do this. - VCP::{Source,Dest}::{p4,cvs} now set binaryness on added files properly, I think. For p4->p4, the native p4 type is preserved. For CVS sources, seeing the keyword substitution flag 'o' or 'b' implies binaryness, for p4, seeing a filetype like qr/u?x?binary/ or qr/x?tempobj/ or "resource" implies binaryness (to non-p4 destinations). NOTE: Seeing a 'o' or 'b' in a CVS source only ends up setting the 'b' option on the destination. That should be ok for most uses, but we can make it smarter for cvs->cvs transfers if need be. |
||
#3 | 473 | Barrie Slaymaker |
0.04 Tue Dec 12 00:15:57 EST 2000 - Reorg of VCP::Source::p4 - One large filelog command is run instead of many small ones. This takes advantage of the -m option to make sure enough changes are listed. Many extra revisions of most files are probably listed, but listing and ignoring them is quicker than spawning p4 over and over. Wish p4 filelog had a revision range... - it now doesn't suck the entire filelog output in to memory, it parses it line by line as it's emitted from the `p4 filelog` - `p4 print` is now used to print a bunch of files at once, using the header line to separate one file from the next, kind of like splitting a mime-encoded message. There's a very slight chance that it will misjudge the boundary between two files if a file happens to have a line that looks very much like the header line for the next file. This is pretty unlikely and I'll fix it if it crops up. I could batch them more, right now it never puts two revisions of the same filename in the same batch, for no really good reason. Another method might be to batch 25 or 50 revs each time. - it turns out there's a problem spawning multiple p4 commands at the same time against the same p4d (p4d is 99.2, FWIW). Or at least running large `p4 files ...` while there's a large `p4 filelog` still also running. - filelog lines beginning with "... ..." are now ignored. These are notifications of copy, branch, and integrate events that we don't yet do anything with. - deleted cur() and P4_CUR - deleted P4_IS_INCREMENTAL - Made an assertion in VCP::Dest::revml::handle_rev() a little clearer - Added some ok(1) calls to 90p4.t to make it easier to figure out which child process is whining or aborting - Made the message that's printed when a subcommand emits unexpected output say "stderr" instead of "stdout". - Cleaned up documentation for VC::Plugin::work_path(). |
||
#2 | 468 | Barrie Slaymaker |
- VCP::Dest::p4 now does change number aggregation based on the comment field changing or whenever a new revision of a file with unsubmitted changes shows up on the input stream. Since revisions of files are normally sorted in time order, this should work in a number of cases. I'm sure we'll need to generalize it, perhaps with a time thresholding function. - t/90cvs.t now tests cvs->p4 replication. - VCP::Dest::p4 now doesn't try to `p4 submit` when no changes are pending. - VCP::Rev now prevents the same label from being applied twice to a revision. This was occuring because the "r_1"-style label that gets added to a target revision by VCP::Dest::p4 could duplicate a label "r_1" that happened to already be on a revision. - Added t/00rev.t, the beginnings of a test suite for VCP::Rev. - Tweaked bin/gentrevml to comment revisions with their change number instead of using a unique comment for every revision for non-p4 t/test-*-in-0.revml files. This was necessary to test cvs->p4 functionality. |
||
#1 | 467 | Barrie Slaymaker | Version 0.01, initial checkin in perforce public depot. |