Deletion of redmine-project should delete svn-project, too
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.
#2 Updated by Lars Scheithauer almost 13 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.
#3 Updated by Kamil . almost 13 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).
#4 Updated by Lars Scheithauer almost 13 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.
#7 Updated by Cyril Lamy almost 12 years ago
- File reposman-patch2.diff added
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.