Dirk schrieb:
Hi,

(Anyone with a .NET filter hack? I've got 710*2 revisions with dummy
Adds and Deletes.)
I think, this could be easily done via a new state "RemoveDotNetCheckin", e.g by cloning the MergeMoveData function. Then search for all "ADD" actions with a specific comment, get the phyiscal ID and remove all vss actions with this physical ID.

I have created a small patch, that is not really tested, it work for me, but I have only 7 dummy checkins. Nevertheless I found one project directory with the same comment, but the project name itself was a real name and not a temporary one. So I excluded projects from beeing deleted.

Sorry, forgot to attach the patch.

Dirk
Index: vss2svn.pl
===================================================================
--- vss2svn.pl  (revision 315)
+++ vss2svn.pl  (working copy)
@@ -70,8 +70,12 @@
 
             # Merge data from move actions 
             MERGEMOVEDATA => {handler => \&MergeMoveData,
-                                next    => 'BUILDACTIONHIST'},
+                                next    => 'REMOVETMPCHECKIN'},
 
+            # Remove temporary check ins
+            REMOVETMPCHECKIN => {handler => \&RemoveTemporaryCheckIns,
+                                 next    => 'BUILDACTIONHIST'},
+
             # Take the history of physical actions and convert them to VSS
             # file actions
             BUILDACTIONHIST => {handler => \&BuildVssActionHistory,
@@ -773,6 +777,42 @@
 }  #  End MergeMoveData
 
 ###############################################################################
+# RemoveTemporaryCheckIns
+# remove temporary checkins that where create to detect MS VSS capabilities
+###############################################################################
+sub RemoveTemporaryCheckIns {
+    my($sth, $rows, $row);
+    $sth = $gCfg{dbh}->prepare('SELECT * FROM PhysicalAction '
+                               . 'WHERE comment = "Temporary file created by 
Visual Studio .NET to detect Microsoft Visual SourceSafe capabilities."'
+                               . '      AND actiontype = "ADD"'
+                               . '      AND itemtype = 2');            # only 
delete files, not projects
+    $sth->execute();
+
+    # need to pull in all recs at once, since we'll be updating/deleting data
+    $rows = $sth->fetchall_arrayref( {} );
+
+    foreach $row (@$rows) {
+        my $physname = $row->{physname};
+        
+        my $sql = 'SELECT * FROM PhysicalAction WHERE physname = ?';
+        my $update = $gCfg{dbh}->prepare($sql);
+        
+        $update->execute( $physname );
+
+                   # need to pull in all recs at once, since we'll be 
updating/deleting data
+                   my $recs = $update->fetchall_arrayref( {} );
+               
+                   foreach my $rec (@$recs) {
+          print "Remove action_id $rec->{action_id}, $rec->{physname}, 
$rec->{actiontype}, $rec->{itemname}\n";
+          print "       $rec->{comment}\n" if defined ($rec->{comment});
+          &DeleteChildRec($rec->{action_id});
+        }
+               }
+
+    1;
+}
+
+###############################################################################
 #  DeleteChildRec
 ###############################################################################
 sub DeleteChildRec {
@@ -1867,7 +1907,8 @@
     --resume          : Resume a failed or aborted previous run
     --task <task>     : specify the task to resume; task is one of the 
following
                         INIT, LOADVSSNAMES, FINDDBFILES, GETPHYSHIST,
-                        MERGEPARENTDATA, BUILDACTIONHIST, IMPORTSVN
+                        MERGEPARENTDATA, MERGEMOVEDATA, REMOVETMPCHECKIN, 
+                        BUILDACTIONHIST, IMPORTSVN
 
     --verbose         : Print more info about the items being processed
     --debug           : Print lots of debugging info.
_______________________________________________
vss2svn-users mailing list
Project homepage:
http://www.pumacode.org/projects/vss2svn/
Subscribe/Unsubscribe/Admin:
http://lists.pumacode.org/mailman/listinfo/vss2svn-users-lists.pumacode.org
Mailing list web interface (with searchable archives):
http://dir.gmane.org/gmane.comp.version-control.subversion.vss2svn.user

Reply via email to