package VCP::Dest::p4 ; =head1 NAME VCP::Dest::p4 - p4 destination driver =head1 SYNOPSIS vcp <source> p4[:<dest>] where <dest> is a filespec to a directory in the perforce repository or on the local client of the directory tree to use when importing files (this is known as the "rev root", for lack of a better term). The <dest> spec is run through the `p4 where` command to get an absolute path on the local filesystem. `p4 where` must generate exactly one line of output, and the line is parsed to strip off the depot and client filespecs, including file and directory names containing spaces (directory names containing trailing spaces are not handled correctly!). See `p4 help where` and the Perforce User's Guide for details on how to specify the <dest>, but here's an overview (do check the Perforce User's Guide to see if your version of `p4 where` behaves differently): =over =item * any //depot/, //client/, or absolute or relative local filesystem spec can be supplied for <dest> (local specs should not begin with "//" even if the local OS would be Ok with it). =item * No need to type "/..." at the end of <dest>, VCP::Dest::p4 adds it if it's missing. =item * Relative specs (or a missing <dest>) are taken (by p4 where) to be relative to the current working directory. =item * You cannot put directory names like "./" or "../" in the middle of any spec, only at the beginning of a relative local filesystem spec. =back VCP::Dest::p4 does change number aggregation, see L<VCP::Dest/rev_cmp_sub> for the order in which revisions are sorted. Once sorted, a change is submitted whenever the change number (if present) changes, the comment (if present) changes, or a new rev of a file with the same name as a revision that's pending. THIS IS EXPERIMENTAL, PLEASE DOUBLE CHECK EVERYTHING! =head1 DESCRIPTION =head1 METHODS =over =cut $VERSION = 1 ; use strict ; use vars qw( $debug ) ; $debug = 0 ; use Carp ; use File::Basename ; use File::Path ; use Getopt::Long ; use VCP::Debug ':debug' ; use VCP::Dest ; use VCP::Rev ; use base 'VCP::Dest' ; use fields ( # 'P4_SPEC', ## The root of the tree to update 'P4_PENDING', ## Revs pending the next submit 'P4_DELETES_PENDING', ## At least one 'delete' needs to be submitted. 'P4_WORK_DIR', ## Where to do the work. ## members for change number divining: 'P4_PREV_CHANGE_ID', ## The change_id in the r sequence, if any 'P4_PREV_COMMENT', ## Used to detect change boundaries ) ; =item new Creates a new instance of a VCP::Dest::p4. Contacts the p4d using the p4 command and gets some initial information ('p4 info' and 'p4 labels'). =cut sub new { my $class = shift ; $class = ref $class || $class ; my VCP::Dest::p4 $self = $class->SUPER::new( @_ ) ; ## Parse the options my ( $spec, $options ) = @_ ; my $parsed_spec = $self->parse_repo_spec( $spec ) ; my $files = $parsed_spec->{FILES} ; $self->{P4_PENDING} = [] ; GetOptions( "ArGhOpTioN" => \"" ) or $self->usage_and_exit ; # No options! $self->command( 'p4' ) ; my @where_spec ; if ( defined $files && length $files ) { @where_spec = ( $files ) ; $where_spec[0] =~ s{(/(\.\.\.)?)?$}{/...} ; } my $where_map ; $self->p4( [ where => @where_spec ], ">", \$where_map ) ; { my @where_map = split /\n/g, $where_map ; die "vcp: `p4 where` did not return a mapping for '$files'\n" unless @where_map ; die( "vcp: `p4 where", map( " '$_'", @where_spec ), "` returned more than one line:\n$where_map" ) unless @where_map == 1 ; } my $work_root = $self->strip_p4_where( $where_map ) ; die "Couldn't parse `p4 where` output\np4 where: $where_map" unless defined $work_root and length $work_root ; $self->work_root( $work_root ) ; $self->command_chdir( $self->work_root ) ; # $self->mkdir( $self->work_path ) ; return $self ; } sub p4 { my VCP::Dest::p4 $self = shift ; local $ENV{P4PASSWD} = $self->repo_password if defined $self->repo_password ; unshift @{$_[0]}, '-p', $self->repo_server if defined $self->repo_server ; if ( defined $self->repo_user ) { my ( $user, $client ) = $self->repo_user =~ m/([^()]*)(?:\((.*)\))?/ ; unshift @{$_[0]}, '-c', $client if defined $client ; unshift @{$_[0]}, '-u', $user ; } my $tmp = $ENV{PWD} ; delete $ENV{PWD} ; $self->SUPER::p4( @_ ) ; $ENV{PWD} = $tmp if defined $tmp ; } =item strip_p4_where Takes a line of output from a `p4 where` command and strips off all but the last filespec. This is a bit tricky in the face of directory names with spaces and is very hard or impossible if a directory name ends in a space. It's a separate function so the test suite can have at it. =cut sub strip_p4_where { shift ; my ( $where_stdout ) = @_ ; 1 while chomp $where_stdout ; # Trim off up to the last "//" and all non-space chars after it. # Also keep trimming until the first " /" to try to work around # spaces in file names. my $path_start_re = $^O =~ /Win|DOS/i ? "(?:[A-Za-z]:)?[\\\\/]" : "/(?!/)" ; $where_stdout =~ s{^.* (?=$path_start_re)}{} or return undef ; $where_stdout =~ s{[\\/]\.\.\.$}{} ; return $where_stdout ; } sub denormalize_name { my VCP::Dest::p4 $self = shift ; return '//' . $self->SUPER::denormalize_name( @_ ) ; } sub backfill { my VCP::Dest::p4 $self = shift ; my VCP::Rev $r ; ( $r ) = @_ ; confess unless defined $self && defined $self->header ; if ( $self->none_seen ) { $self->rev_root( $self->header->{rev_root} ) unless defined $self->rev_root ; } my $fn = $self->denormalize_name( $r->name ) ; ## The depot name was handled by the client view. $fn =~ s{^//[^/]+/}{} ; debug "vcp: backfilling '$fn', rev ", $r->rev_id if debugging $self ; my $work_path = $self->work_path( $fn ) ; debug "vcp: work_path '$work_path'" if debugging $self ; my VCP::Rev $saw = $self->seen( $r ) ; die "Can't backfill already seen file '", $r->name, "'" if $saw ; my ( undef, $work_dir ) = fileparse( $work_path ) ; unless ( -d $work_dir ) { $self->mkpdir( $work_path ) ; ( undef, $work_dir ) = fileparse( $fn ) ; } my $tag = "r_" . $r->rev_id ; $tag =~ s/\W+/_/g ; ## The -f forces p4 to sync even if it thinks it doesn't have to. It's ## not in there for any known reason, just being conservative. $self->p4( ['sync', '-f', "$fn\@$tag" ] ) ; die "'$work_path' not created in backfill" unless -e $work_path ; $r->work_path( $work_path ) ; return 1 ; } sub handle_rev { my VCP::Dest::p4 $self = shift ; my VCP::Rev $r ; ( $r ) = @_ ; debug "vcp: handle_rev got $r ", $r->name if debugging $self ; ## TODO: Build a view as needed that maps P4_SPEC on to the ## /tmp/... workspace. could even modify an existing view, I ## suppose, but I don't want to risk damaging an existing view. if ( $self->none_seen ) { $self->rev_root( $self->header->{rev_root} ) unless defined $self->rev_root ; } if ( ( @{$self->{P4_PENDING}} || $self->{P4_DELETES_PENDING} ) && ( ( defined $r->change_id && defined $self->{P4_PREV_CHANGE_ID} && $r->change_id ne $self->{P4_PREV_CHANGE_ID} && ( debugging( $self ) ? debug "vcp: change_id changed" : 1 ) ) || ( defined $r->comment && defined $self->{P4_PREV_COMMENT} && $r->comment ne $self->{P4_PREV_COMMENT} && ( debugging( $self ) ? debug "vcp: comment changed" : 1 ) ) || ( grep( $r->name eq $_->name, @{$self->{P4_PENDING}} ) && ( debugging( $self ) ? debug "vcp: name repeated" : 1 ) ) ) ) { $self->submit ; } my VCP::Rev $saw = $self->seen( $r ) ; my $fn = $self->denormalize_name( $r->name ) ; ## The depot name was handled by the client view. $fn =~ s{^//[^/]+/}{} ; debug "vcp: importing '$fn'" if debugging $self ; my $work_path = $self->work_path( $fn ) ; debug "vcp: work_path '$work_path'" if debugging $self ; if ( $r->action eq 'delete' ) { unlink $work_path || die "$! unlinking $work_path" ; $self->p4( ['delete', $fn] ) ; $self->{P4_DELETES_PENDING} = 1 ; $self->delete_seen( $r ) ; } else { ## TODO: Don't assume same filesystem or working link(). { my $filetype = defined $r->p4_info && $r->p4_info =~ /\((\S+)\)$/ ? $1 : $r->type ; my $add_it ; if ( -e $work_path ) { $self->p4( ["edit", "-t", $filetype, $fn] ) ; unlink $work_path or die "$! unlinking $work_path" ; } else { $self->mkpdir( $work_path ) ; $add_it = 1 ; } debug "vcp: linking ", $r->work_path, " to $work_path" if debugging $self ; link $r->work_path, $work_path or die "$! linking ", $r->work_path, " -> $work_path" ; $r->dest_work_path( $work_path ) ; if ( defined $r->mod_time ) { utime $r->mod_time, $r->mod_time, $work_path or die "$! changing times on $work_path" ; } if ( $add_it ) { $self->p4( ["add", "-t", $filetype, $fn] ) ; } } unless ( $saw ) { ## New file. } my $tag = "r_" . $r->rev_id ; $tag =~ s/\W+/_/g ; $r->add_label( $tag ) ; if ( defined $r->change_id ) { my $tag = "ch_" . $r->change_id ; $tag =~ s/\W+/_/g ; $r->add_label( $tag ) ; } ## TODO: Provide command line options for user-defined tag prefixes debug "vcp: saving off $r ", $r->name, " in PENDING" if debugging $self ; push @{$self->{P4_PENDING}}, $r ; } $self->{P4_PREV_CHANGE_ID} = $r->change_id ; debug "vcp: done importing '$fn'" if debugging $self ; debug "vcp: cleaning up $saw ", $saw->name, " in PENDING" if $saw && debugging $self ; $self->{P4_PREV_COMMENT} = $r->comment ; } sub handle_footer { my VCP::Dest::p4 $self = shift ; $self->submit if @{$self->{P4_PENDING}} || $self->{P4_DELETES_PENDING} ; $self->SUPER::handle_footer ; } sub submit { my VCP::Dest::p4 $self = shift ; my %pending_labels ; my %comments ; my $max_time ; if ( @{$self->{P4_PENDING}} ) { for my $r ( @{$self->{P4_PENDING}} ) { $comments{$r->comment} = $r->name if defined $r->comment ; $max_time = $r->time if ! defined $max_time || $r->time > $max_time ; for my $l ( $r->labels ) { push @{$pending_labels{$l}}, $r->dest_work_path ; } } my @f = reverse( (localtime $max_time)[0..5] ) ; $f[0] += 1900 ; ++$f[1] ; ## Day of month needs to be 1..12 $max_time = sprintf "%04d/%02d/%02d %02d:%02d:%02d", @f ; } my $description = join( "\n", keys %comments ) ; if ( length $description ) { $description =~ s/^/\t/gm ; $description .= "\n" if substr $description, -1 eq "\n" ; } my $change ; $self->p4( [ 'change', '-o' ], \$change ) ; if ( defined $max_time ) { $change =~ s/^Date:.*\r?\n\r/Date:\t$max_time\n/m or $change =~ s/(^Client:)/Date:\t$max_time\n\n$1/m or die "vcp: Couldn't modify change date\n$change" ; } $change =~ s/^Description:.*\r?\n\r?.*/Description:\n$description/m or die "vcp: Couldn't modify change description\n$change" ; $self->p4([ 'submit', '-i'], '<', \$change ) ; ## Create or add a label spec for each of the labels. The 'sort' is to ## make debugging output more legible. ## TODO: Modify RevML to allow label metadata (owner, desc, options) ## to be passed through. Same for user, client, jobs metadata etc. ## The assumption is made that most labels will apply to a single change ## number, so we do the labelling once per submit. I don't think that ## this will break if it doesn't, but TODO: add more labelling tests. for my $l ( sort keys %pending_labels ) { my $label_desc ; $self->p4( [qw( label -o ), $l], '>', \$label_desc ) ; $self->p4( [qw( label -i ) ], '<', \$label_desc ) ; $self->p4( [qw( labelsync -a -l ), $l, @{$pending_labels{$l}}] ) ; } @{$self->{P4_PENDING}} = () ; $self->{P4_DELETES_PENDING} = undef ; } sub tag { my VCP::Dest::p4 $self = shift ; my $tag = shift ; $tag =~ s/\W+/_/g ; $self->p4( ['tag', $tag, @_] ) ; } ## Prevent VCP::Plugin from rmtree-ing the workspace we're borrowing sub DESTROY { my VCP::Dest::p4 $self = shift ; $self->work_root( undef ) ; $self->SUPER::DESTROY ; } =back =head1 SUBCLASSING This class uses the fields pragma, so you'll need to use base and possibly fields in any subclasses. =head1 COPYRIGHT Copyright 2000, Perforce Software, Inc. All Rights Reserved. This module and the VCP package are licensed according to the terms given in the file LICENSE accompanying this distribution, a copy of which is included in L<vcp>. =head1 AUTHOR Barrie Slaymaker <barries@slaysys.com> =cut 1
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#129 | 5402 | Barrie Slaymaker | - Disallow "?" in p4 names | ||
#128 | 4521 | Barrie Slaymaker | - Debugging lg() calls removed | ||
#127 | 4520 | Barrie Slaymaker |
- VCP::Dest::p4 another "No file(s) to resolve" error squashed - This occured when cloning or branching a file over a previously deleted file |
||
#126 | 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 |
||
#125 | 4489 | Barrie Slaymaker | - removed commented-out debug code | ||
#124 | 4476 | Barrie Slaymaker | - misc bugfixes | ||
#123 | 4416 | Barrie Slaymaker | - VCP::Dest::p4 tries not to send pre-epoch timestamps to p4 | ||
#122 | 4411 | Barrie Slaymaker | - missing metadata is logged in the log file | ||
#121 | 4166 | Barrie Slaymaker | - No more VCP::Dest::p4 BUG on labelling a freshly branch file | ||
#120 | 4165 | Barrie Slaymaker |
- VCP::Source::null now returns /dev/null or NUL for files - VCP::Dest::p4 now watches is_branch_rev() to detect branches - t/99p4_label_branch_rev_1.t reproduces a bug reported by Matt Attaway < matt at perforce com > |
||
#119 | 4033 | Barrie Slaymaker | - VCP::Dest::p4 now really estimates time | ||
#118 | 4032 | Barrie Slaymaker | - VCP::Dest::p4 now estimates missing metadata | ||
#117 | 4021 | Barrie Slaymaker |
- Remove all phashes and all base & fields pragmas - Work around SWASHGET error |
||
#116 | 4012 | Barrie Slaymaker | - Remove dependance on pseudohashes (deprecated Perl feature) | ||
#115 | 4006 | Barrie Slaymaker | - VCP will now use the P4::Client module if it's installed. | ||
#114 | 4003 | Barrie Slaymaker |
- VCP::Dest::p4 now prevents illegal filenames, user_ids, and label names |
||
#113 | 3997 | Barrie Slaymaker | - Limit p4 integrate size to 100 files | ||
#112 | 3975 | Barrie Slaymaker |
- VCP::Dest::p4 can now branch the same file multiple times in one change. |
||
#111 | 3970 | Barrie Slaymaker |
- VCP::Source handles rev queing, uses disk to reduce RAM - Lots of other fixes |
||
#110 | 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 |
||
#109 | 3916 | Barrie Slaymaker | - Reduce memory consumption | ||
#108 | 3907 | Barrie Slaymaker | - Debugging cleanups | ||
#107 | 3903 | Barrie Slaymaker | - Minor debug logging impovements | ||
#106 | 3893 | Barrie Slaymaker | - p4d is now launched in the proper directory | ||
#105 | 3855 | Barrie Slaymaker |
- vcp scan, filter, transfer basically functional - Need more work in re: storage format, etc, but functional |
||
#104 | 3850 | Barrie Slaymaker | - No longer stores all revs in memory | ||
#103 | 3837 | Barrie Slaymaker | - Improved progress bar support | ||
#102 | 3813 | Barrie Slaymaker | - VCP::Rev::previous() is no more | ||
#101 | 3812 | Barrie Slaymaker | - VCP::Dest::* no longer need VCP::Rev->previous() | ||
#100 | 3811 | Barrie Slaymaker | - fetch_*() and get_rev() renamed get_source_file() | ||
#99 | 3805 | Barrie Slaymaker | - VCP::Revs::fetch_files() removed | ||
#98 | 3754 | Barrie Slaymaker |
- VCP::Dest::p4 no longer tries to label files the current change just deleted. |
||
#97 | 3749 | Barrie Slaymaker | - error message tweaked | ||
#96 | 3748 | Barrie Slaymaker | - VCP::Dest::p4 dies when trying to branch to/from same file | ||
#95 | 3741 | Barrie Slaymaker | - Minor message cleanup | ||
#94 | 3712 | Barrie Slaymaker | - Bogus confess() doesn't bite any more | ||
#93 | 3706 | Barrie Slaymaker | - VCP gives some indication of output progress (need more) | ||
#92 | 3647 | Barrie Slaymaker |
- All UI prompts & descriptions rewritten. - Minor tweak to VCP::Dest::p4 P4USER defaulting |
||
#91 | 3572 | John Fetkovich | added y/n question to accept default of user_id | ||
#90 | 3569 | Barrie Slaymaker |
- Work around bug caused by p4's using the long pathname when $ENV{PWD} is not set. |
||
#89 | 3518 | John Fetkovich | more interactive ui improvements | ||
#88 | 3498 | Barrie Slaymaker | - Fix changeset boundary detection bug in VCP::Dest::p4 | ||
#87 | 3491 | Barrie Slaymaker | - All sections are now documented in generated config files | ||
#86 | 3460 | Barrie Slaymaker |
- Revamp Plugin/Source/Dest hierarchy to allow for reguritating options in to .vcp files |
||
#85 | 3442 | Barrie Slaymaker | - Win32 regex fixup for label specs | ||
#84 | 3432 | Barrie Slaymaker | - "p4 print" to "p4 sync" | ||
#83 | 3423 | Barrie Slaymaker | - Use the new VCP::Utils::p4::split_repo_server() | ||
#82 | 3411 | Barrie Slaymaker |
- p4 output parsing improvment - clearer log messages |
||
#81 | 3402 | Barrie Slaymaker |
- now passes all tests using the p4 api library. (still not default, set env var VCPP4API=1) - foo->p4 handles branch-but-no-change case when --change-branch-rev-1 is passed. - sources & dests can now provide their own command execution routine in place of shelling out to an external command (as in call the p4api library instead of running the p4 command). |
||
#80 | 3382 | John Fetkovich |
Moved setting of repo_id to 'sub init' moved defaulting of repo_server to P4PORT env var to 'sub init' |
||
#79 | 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. |
||
#78 | 3277 | John Fetkovich | split out 'sub init' from 'sub new' | ||
#77 | 3207 | John Fetkovich | doc (pod) fixes | ||
#76 | 3187 | Barrie Slaymaker |
Tweak p4 change -o replacement logic to work with command line client. |
||
#75 | 3186 | Barrie Slaymaker | cleanup | ||
#74 | 3185 | Barrie Slaymaker | Reduce number of p4 changes commands to 1 per p4 submit. | ||
#73 | 3169 | Barrie Slaymaker |
Log the stdout of all p4 submits use -x - for p4 integrate calls. Avoid Carp; use BUG. |
||
#72 | 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. |
||
#71 | 3139 | Barrie Slaymaker | Batch calls to p4 integrate | ||
#70 | 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). |
||
#69 | 3127 | Barrie Slaymaker | Minor cleanups. | ||
#68 | 3120 | Barrie Slaymaker | Move changeset aggregation in to its own filter. | ||
#67 | 3117 | Barrie Slaymaker |
Cut over to faster VCP::Rev::new, remove symbolic method calls. |
||
#66 | 3104 | John Fetkovich |
Added handling of VCPP4LICENSE environment variable in Dest::p4.pm. If that's present and pointing to a readable file when a p4 daemon is started, a symlink will be created in the (possibly newly created) p4root directory to point to the p4 license file pointed to by VCPP4LICENSE. The 'make' target test_all_p4_versions will cycle through each version of p4 and p4d contained in the 'p4versions' directory, in both unlicensed and (if VCPP4LICENSE present) licensed mode. |
||
#65 | 3098 | Barrie Slaymaker |
Convert all length p4 command line calls to us p4 -x -. All hail p4 -x -. |
||
#64 | 3081 | Barrie Slaymaker |
Get cvs->p4 propogation branches with multiple tags working to spec. |
||
#63 | 3076 | Barrie Slaymaker | Improve change aggregation | ||
#62 | 3066 | Barrie Slaymaker |
Set time correctly on integrate and pre-delete add changes. |
||
#61 | 3031 | Barrie Slaymaker |
Fix empty branch creation batch adds, edits, and deletes rearrange for code maintainability |
||
#60 | 3029 | Barrie Slaymaker |
Improve state database (does not affect operation, but was causing some interesting information to be missing when using bin/dump_* |
||
#59 | 3021 | Barrie Slaymaker |
Force integrate to branch from proper revision and allow it to branch from the predecessor of a deleted file (CVS allows file deletes). |
||
#58 | 3011 | Barrie Slaymaker | Free memory and delete files more aggressively | ||
#57 | 2981 | Barrie Slaymaker | quash some output | ||
#56 | 2980 | Barrie Slaymaker |
Don't let placeholders count as a needed previous revision when splitting the rev stream in to changes. |
||
#55 | 2976 | Barrie Slaymaker |
Force submittal of parent revision if a child rev of it arrives before it is submitted. |
||
#54 | 2973 | Barrie Slaymaker | Fix handling of branched but unchanged files | ||
#53 | 2972 | Barrie Slaymaker | Interim checkin | ||
#52 | 2930 | John Fetkovich | added empty() calls | ||
#51 | 2926 | John Fetkovich |
remove --state-location switch add --db-dir and --repo-id switches build state location from concatenation of those two. |
||
#50 | 2915 | Barrie Slaymaker |
Default to *not* changing the first rev of a branch, add --change-branch-rev-1 to enable the non-default behavior (which is what is used by most of the test suite). |
||
#49 | 2913 | Barrie Slaymaker | Put a user id on each change | ||
#48 | 2912 | Barrie Slaymaker | Remove spurious warn()ing | ||
#47 | 2910 | Barrie Slaymaker | Update the submit time of each change. | ||
#46 | 2908 | Barrie Slaymaker | Suppress "refreshed" messages | ||
#45 | 2907 | Barrie Slaymaker |
Use persistent state file to track what's been seen so that delete/add/edit decisions work accross incremental imports |
||
#44 | 2838 | John Fetkovich | Use parse_options rather than using Getopt::Long directly. | ||
#43 | 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. |
||
#42 | 2774 | Barrie Slaymaker | Update HeadRevDB on submit/commit/write | ||
#41 | 2770 | Barrie Slaymaker | tweak dump utils: sort output for readability | ||
#40 | 2721 | Barrie Slaymaker | VCP::Dest::p4 now uses RevMapDB | ||
#39 | 2698 | Barrie Slaymaker |
Don't add r_ and ch_ labels, switch to underscorify_name() to get standardized escaping of illegal p4 labels (still need to discover what, exactly, a legal p4 label name is). |
||
#38 | 2664 | Barrie Slaymaker | Try IPC::Run3 to see if it speeds up p4 calls | ||
#37 | 2641 | Barrie Slaymaker |
Add --run-p4d option to VCP::{Source,Dest}::p4. Implement port hunting and p4d up & ready detection for vcp-launched p4ds. |
||
#36 | 2589 | John Fetkovich |
Split 90p4.t into 90revml2p4_0.t, 90revml2p4_1.t, 91p42revml.t, 95p42cvs.t. Added some utilities to the library files listed. |
||
#35 | 2350 | Barrie Slaymaker |
Get p4d to be killed after the last p4 cleanup commands, generalize the p4d launching & destruction system because we'll need it in VCP::Source::p4 too to take checkpoints. |
||
#34 | 2344 | Barrie Slaymaker | Make the labelsync code more self-documenting | ||
#33 | 2336 | Barrie Slaymaker | Notify user when shutting down p4d | ||
#32 | 2333 | Barrie Slaymaker | Tweak logging of p4d command | ||
#31 | 2332 | Barrie Slaymaker | Add --init-p4d and --delete-p4d-dir options | ||
#30 | 2322 | Barrie Slaymaker | Fix jack-in-the-bug options parsing exposed by .vcp files | ||
#29 | 2276 | Barrie Slaymaker |
optimize away extra p4 label -o / -i calls for speed, elegance update t/90p4.t |
||
#28 | 2059 | Barrie Slaymaker | Support for branching in p4->p4 added | ||
#27 | 2049 | Barrie Slaymaker | Get branching working in Dest::p4, clean up some tests. | ||
#26 | 2042 | Barrie Slaymaker | Basic source::p4 branching support | ||
#25 | 2009 | Barrie Slaymaker |
lots of fixes, improve core support for branches and VCP::Source::cvs now supports branches. |
||
#24 | 1855 | Barrie Slaymaker |
Major VSS checkin. Works on Win32 |
||
#23 | 1809 | Barrie Slaymaker | VCP::Patch should ignore lineends | ||
#22 | 1367 | Barrie Slaymaker | lots of docco updates | ||
#21 | 1055 | Barrie Slaymaker |
add sorting, revamp test suite, misc cleanup. Dest/revml is not portable off my system yet (need to release ...::Diff) |
||
#20 | 827 | Barrie Slaymaker | Add a test for and debug p4->cvs incremental exports. | ||
#19 | 825 | Barrie Slaymaker |
test, handle case where no revs are transferred and VCP::Dest::*::handle_footer() blew up. |
||
#18 | 824 | Barrie Slaymaker | Fix p4 backfilling path math to not mangle paths. | ||
#17 | 812 | Barrie Slaymaker |
A more sensible name for on_first_rev(), and allow incremental foo->p4 updates to work by backfilling the base rev instead of trying to add it. |
||
#16 | 723 | Barrie Slaymaker | VCP::Dest::cvs tuning and cvs and p4 bugfixes | ||
#15 | 705 | Barrie Slaymaker | Release 0.22. | ||
#14 | 703 | Barrie Slaymaker | VCP::Source::p4 now uses VCP::Utils::p4::parse_p4_repo_spec() | ||
#13 | 701 | Barrie Slaymaker | Fixed VCP::Dest::p4 re-rooting problem, further t/* cleanup | ||
#12 | 700 | Barrie Slaymaker | Delete orphan code | ||
#11 | 692 | Barrie Slaymaker |
Add VCP::Utils::p4 and use it to get VCP::Dest::p4 to create it's own client view as needed. |
||
#10 | 689 | Barrie Slaymaker |
reinstate -f behavior as the default for VCP::Source::cvs, clean up -D --> -d doco. |
||
#9 | 674 | Barrie Slaymaker |
Fix paths passed to p4 labelsync in VCP::Des::P4, reported by david d zuhn <zoo@bravara.com> |
||
#8 | 669 | Barrie Slaymaker |
0.1 Wed Jul 4 00:27:35 EDT 2001 Fix VCP::Dest::p4 to take the filespec from the p4:<dest> spec and use it as the rev_root. No --rev-root option at this time, not sure if it's needed. Reported by david d zuhn <zoo@bravara.com>. |
||
#7 | 628 | Barrie Slaymaker | Cleaned up POD in bin/vcp, added BSD-style license. | ||
#6 | 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. |
||
#5 | 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. |
||
#4 | 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. |
||
#3 | 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. |
||
#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. |