Project

General

Profile

Actions

Patch #4029

open

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

Added by Lars Scheithauer over 14 years ago. Updated almost 13 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
SCM extra
Target version:
-
Start date:
2009-10-14
Due date:
% Done:

0%

Estimated time:

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
Actions #1

Updated by Kamil . over 14 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?

Actions #2

Updated by Lars Scheithauer over 14 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.

Actions #3

Updated by Kamil . over 14 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).

Actions #4

Updated by Lars Scheithauer over 14 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

Actions #5

Updated by Anthony Paul almost 14 years ago

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

Actions #6

Updated by Lars Scheithauer almost 14 years ago

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

Actions #7

Updated by Cyril Lamy over 13 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

Actions #8

Updated by Cyril Lamy over 13 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

Actions #9

Updated by Toshi MARUYAMA almost 13 years ago

  • Category changed from SCM to SCM extra
Actions

Also available in: Atom PDF