From 1aa9676f578915df755a49c800981b8f10125b9d Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Thu, 17 Nov 2016 18:54:40 -0800 Subject: [PATCH] Project.pm: remember users when archiving When a project is archived, girocco.recycletime is set to the recycle time. For push projects also set girocco.recycleusers to the list of push users (if there are any) just before setting girocco.recycletime. With this additional information restoration should be easier. Signed-off-by: Kyle J. McKay --- Girocco/Project.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Girocco/Project.pm b/Girocco/Project.pm index ffe2192..eaa5de9 100644 --- a/Girocco/Project.pm +++ b/Girocco/Project.pm @@ -1125,6 +1125,11 @@ sub archive_and_delete { or die "Unable to compute suitable archive path"; system('mv', $self->{path}, "$destdir$destbase$suffix.git") == 0 or die "mv \"$self->{path}\" \"$destdir$destbase$suffix.git\" failed: $?"; + if (!$self->{mirror} && @{$self->{users}}) { + # Remember the user list at recycle time + system($Girocco::Config::git_bin, '--git-dir='.$destdir.$destbase.$suffix.".git", + 'config', 'girocco.recycleusers', join(",", @{$self->{users}})); + } my ($S,$M,$H,$d,$m,$y) = gmtime(time()); my $recycletime = strftime("%Y-%m-%dT%H:%M:%SZ", $S, $M, $H, $d, $m, $y, -1, -1, -1); # We ought to do something if this fails, but the project has already been moved -- 2.11.4.GIT