List Info

Thread: Fix wrong deleting order




Fix wrong deleting order
country flaguser name
Belarus
2007-03-30 14:07:33
Hi,

I would propose a patch that fixes a wrong order of deleting
subfolders that
were deleted at the same second. For instance we have a vss
database with
projects:

$/
    Project
        SubProject
    SubProject

It is possible to delete projects $/Project and
$/Project/SubProject at the
same second using ss.exe utility. In that case after
converting the project
$/SubProject also will be deleted in dump file, because
vss2svn deletes
$/Project, than $/SubProject instead of
$/Project/SubProject.

Patch file as well as test source vss database attached to
this message.

Regards,
Sergei Meleshko.


Index: script/vss2svn.pl
============================================================
=======
--- script/vss2svn.pl        (revision 305)
+++ script/vss2svn.pl        (working copy)
 -296,7
+296,7 

     my($parentdata, $version, $vernum, $action, $name,
$actionid,
$actiontype,
        $tphysname, $itemname, $itemtype, $parent, $user,
$timestamp,
$comment,
-       $is_binary, $info, $priority, $sortkey, $label,
$cachename);
+       $is_binary, $info, $priority, $sortkey1, $sortkey2,
$label,
$cachename);

 VERSION:
     foreach $version ({ $xml-> }) {
 -430,11
+430,17 

         # store the reversed physname as a sortkey; a bit
wasteful but
makes
         # debugging easier for the time being...
-        $sortkey = reverse($tphysname);
+        if ($actiontype eq 'DELETE') {
+            $sortkey1 = '';
+            $sortkey2 = reverse($tphysname);
+        } else {
+            $sortkey1 = reverse($tphysname);
+            $sortkey2 = '';
+        }

         $cache->add($tphysname, $vernum, $parentphys,
$actiontype,
$itemname,
                     $itemtype, $timestamp, $user,
$is_binary, $info,
$priority,
-                    $sortkey, $parentdata, $label,
$comment);
+                    $sortkey1, $sortkey2, $parentdata,
$label, $comment);

     }

 -706,7
+712,7 
     my($sth, $row, $action, $handler, $physinfo,
$itempaths,
$allitempaths);

     my $sql = 'SELECT * FROM PhysicalAction ORDER BY
timestamp ASC, '
-            . 'itemtype ASC, priority ASC, sortkey ASC,
action_id ASC';
+            . 'itemtype ASC, priority ASC, sortkey1 ASC,
sortkey2 DESC,
action_id ASC';

     $sth = $gCfg->prepare($sql);
     $sth->execute();
 -1414,7
+1420,8 
         is_binary   INTEGER,
         info        VARCHAR,
         priority    INTEGER,
-        sortkey     VARCHAR,
+        sortkey1    VARCHAR,
+        sortkey2    VARCHAR,
         parentdata  INTEGER,
         label       VARCHAR,
         comment     TEXT
 -1429,7
+1436,8 
     PhysicalAction_IDX1 ON PhysicalAction (
         timestamp   ASC,
         priority    ASC,
-        sortkey     ASC
+        sortkey1    ASC,
+        sortkey2    DESC
     )
 EOSQL

_______________________________________________
vss2svn-users mailing list
Project homepage:
http://www.
pumacode.org/projects/vss2svn/
Subscribe/Unsubscribe/Admin:
http://lists.pumacode.org/mailman/lis
tinfo/vss2svn-users-lists.pumacode.org
Mailing list web interface (with searchable archives):
http://dir.gmane.org/gmane.comp.version-c
ontrol.subversion.vss2svn.user
  
Re: Fix wrong deleting order
country flaguser name
United States
2007-04-17 09:52:07
Sergei Meleshko wrote:
> Hi,
>
> I would propose a patch that fixes a wrong order of
deleting 
> subfolders that
> were deleted at the same second. For instance we have a
vss database with
> projects:
>
> $/
>    Project
>        SubProject
>    SubProject
>
> It is possible to delete projects $/Project and
$/Project/SubProject 
> at the
> same second using ss.exe utility. In that case after
converting the 
> project
> $/SubProject also will be deleted in dump file, because
vss2svn deletes
> $/Project, than $/SubProject instead of
$/Project/SubProject.
>
> Patch file as well as test source vss database attached
to this message.

Hi Sergei, thanks for the patch; I apologize I haven't had a
chance to 
look at it yet but I've created ticket #50 to make sure it
doesn't get lost.

toby

_______________________________________________
vss2svn-users mailing list
Project homepage:
http://www.
pumacode.org/projects/vss2svn/
Subscribe/Unsubscribe/Admin:
http://lists.pumacode.org/mailman/lis
tinfo/vss2svn-users-lists.pumacode.org
Mailing list web interface (with searchable archives):
http://dir.gmane.org/gmane.comp.version-c
ontrol.subversion.vss2svn.user


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )