Patch #4029

Deletion of redmine-project should delete svn-project, too

Added by Lars Scheithauer almost 12 years ago. Updated over 10 years ago.

Status:NewStart date:2009-10-14
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:SCM extra
Target version:-

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.

reposman.diff Magnifier (1.91 KB) Lars Scheithauer, 2009-10-14 15:05

reposman-patch2.diff Magnifier (2.46 KB) Cyril Lamy, 2010-10-07 11:16

reposman-patch2.diff Magnifier (5.18 KB) Cyril Lamy, 2010-10-07 14:15

History

#1 Updated by Kamil . almost 12 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?

#2 Updated by Lars Scheithauer almost 12 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 12 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 12 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

#5 Updated by Anthony Paul over 11 years ago

Thank you for this patch Lars.
I need it for the same purpose, and it works like a charm!

#6 Updated by Lars Scheithauer over 11 years ago

Hi Anthony,
nice to hear that. I still hope it get's mainlined.
Best Regards,
Lars

#7 Updated by Cyril Lamy almost 11 years ago

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

#8 Updated by Cyril Lamy almost 11 years ago

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

#9 Updated by Toshi MARUYAMA over 10 years ago

  • Category changed from SCM to SCM extra

Also available in: Atom PDF