Patch #4029
openDeletion of redmine-project should delete svn-project, too
Added by Lars Scheithauer about 15 years ago. Updated over 13 years ago.
0%
Description
This small modification adds another argument --delete to extra/svn/reposman.rb.
Adding this argument to the cronjob will match the registered redmine projects against the folders in the svn repository directory and delete any obsolete svn repositories.
Files
reposman.diff (1.91 KB) reposman.diff | Lars Scheithauer, 2009-10-14 15:05 | ||
reposman-patch2.diff (2.46 KB) reposman-patch2.diff | Cyril Lamy, 2010-10-07 11:16 | ||
reposman-patch2.diff (5.18 KB) reposman-patch2.diff | Cyril Lamy, 2010-10-07 14:15 |
Updated by Kamil . about 15 years ago
Did I understood you well that you want to delete project in repo when deleting project in redmine?
If yes - what about migrating particular project to another tool?
Updated by Lars Scheithauer about 15 years ago
Kamil . wrote:
Did I understood you well that you want to delete project in repo when deleting project in redmine?
If yes - what about migrating particular project to another tool?
Yes, the script extends the cronjob and adds an option "--delete", which deletes subversion repositories for which no project in redmine exists.
I'm not sure what you mean by migrating to another tool.
Updated by Kamil . about 15 years ago
Well, when I (for example) was migrating from Trac to Redmine - I have removed the project from Trac and added repository url to new Redmine installation.
Should then Trac delete all my data and code from svn? I don't think so...
Not even mentioning about archivization purposes (although the project is gone, data should exists somewhere in the repo anyway).
Updated by Lars Scheithauer about 15 years ago
yes, of course there are cases in which you don't want the cronjob to delete the repositories, but there are use-cases, where that is exactly what you want - that is why I added another option to it. If this option doesn't fit your usecase, then simply don't use it. :)
We are using redmine at university and want our students to be able to register their own projects, without interfering with each other. So I wrote a plugin that allows non-members to create a project and sets the creator as manager for that project. But if we delete a student project as admins, we don't want to delete every single svn-repository from hand - this is where the patch comes in, which does that for us.
So, we (and possibly other persons, too) benefit from the patch and I would like to see this patch added into the mainline of redmine. It is only an optional argument, doesn't break or interfere with any existing installation (AFAIK of course) and has a usecase (which IMHO are the three things necessary for an implementation).
Of course, I'm human and thus might have put an error in, so I'd like to hear the opinions of others about the code. I also have to add, that I've seen RoR for the first time during the coding of the patch.
And a word about archiving: If the patch is useful enough, it shouldn't be a problem to add another switch to not delete a project but move it to some other repository or something, but for our usecase, that is not needed. Our archiving is done through the regular backup process.
Best Regards,
Lars
Updated by Anthony Paul over 14 years ago
Thank you for this patch Lars.
I need it for the same purpose, and it works like a charm!
Updated by Lars Scheithauer over 14 years ago
Hi Anthony,
nice to hear that. I still hope it get's mainlined.
Best Regards,
Lars
Updated by Cyril Lamy about 14 years ago
- File reposman-patch2.diff reposman-patch2.diff added
Hi,
I've made two minors changes to this patch.
First, added "require 'fileutils'" to get it working with the 1.0.2 version.
Next, deleting is now working in test mode (--delete --test),
allowing to see the name of repositories that doesn't exist in redmine anymore
without deleting them.
Best Regards
Updated by Cyril Lamy about 14 years ago
- File reposman-patch2.diff reposman-patch2.diff added
Sorry, the above patch was not the final version.
This is the final patch allowing to create archives (with tar command) before deleting repositories
Syntax : --archive-dir=/path/to/directory
Updated by Toshi MARUYAMA over 13 years ago
- Category changed from SCM to SCM extra