-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from aik099/path-removal-propagation-fix
Corrected refs removal upon project removal
- Loading branch information
Showing
5 changed files
with
173 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
migrations/20241019_1708_propagate_path_revision_deleted.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
use ConsoleHelpers\DatabaseMigration\MigrationContext; | ||
|
||
return function (MigrationContext $context) { | ||
$db = $context->getDatabase(); | ||
|
||
$sql = 'SELECT Path, RevisionDeleted | ||
FROM Paths | ||
WHERE Path LIKE "%/" AND RevisionDeleted IS NOT NULL'; | ||
$deleted_paths = $db->fetchPairs($sql); | ||
|
||
if ( !$deleted_paths ) { | ||
return; | ||
} | ||
|
||
foreach ( $deleted_paths as $path => $revision ) { | ||
$sql = 'UPDATE Paths | ||
SET RevisionDeleted = :revision | ||
WHERE Path LIKE :path AND RevisionDeleted IS NULL'; | ||
$db->perform($sql, array('revision' => $revision, 'path' => $path . '%')); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
.../SVNBuddy/Repository/RevisionLog/Plugin/fixtures/paths/svn_log_path_deleted_propagate.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?xml version="1.0"?> | ||
<log> | ||
<logentry revision="50"> | ||
<author>user</author> | ||
<date>2015-10-13T13:30:16.473960Z</date> | ||
<paths> | ||
<path action="A" kind="dir">/path</path> | ||
</paths> | ||
<msg>message</msg> | ||
</logentry> | ||
<logentry revision="60"> | ||
<author>user</author> | ||
<date>2015-10-13T13:30:16.473960Z</date> | ||
<paths> | ||
<path action="A" kind="dir">/path/folder_a</path> | ||
<path action="A" kind="file">/path/folder_a/file_a.txt</path> | ||
<path action="A" kind="dir">/path/folder_a/sub_folder_a</path> | ||
<path action="A" kind="dir">/path/folder_b</path> | ||
</paths> | ||
<msg>message</msg> | ||
</logentry> | ||
<logentry revision="70"> | ||
<author>user</author> | ||
<date>2015-10-13T13:30:16.473960Z</date> | ||
<paths> | ||
<path action="A" kind="file">/path/folder_a/sub_folder_a/sub_file_a.txt</path> | ||
</paths> | ||
<msg>message</msg> | ||
</logentry> | ||
<logentry revision="100"> | ||
<author>user</author> | ||
<date>2015-10-13T13:30:16.473960Z</date> | ||
<paths> | ||
<path action="D" kind="file">/path/folder_a/file_a.txt</path> | ||
</paths> | ||
<msg>message</msg> | ||
</logentry> | ||
<logentry revision="200"> | ||
<author>user</author> | ||
<date>2015-10-13T13:30:16.473960Z</date> | ||
<paths> | ||
<path action="D" kind="dir">/path/folder_a</path> | ||
</paths> | ||
<msg>message</msg> | ||
</logentry> | ||
</log> |