about summary refs log tree commit homepage
path: root/lib/PublicInbox/AdminEdit.pm
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2019-06-10 16:58:55 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2019-06-10 17:53:08 +0000
commit6e507c8cb41b0d48963503a88034348d74506211 (patch)
tree396c754ab7983c06be1bb966304d91e8bfdcd389 /lib/PublicInbox/AdminEdit.pm
parent45890d532f0ea68f5879b036b22d9dbd4e19754c (diff)
downloadpublic-inbox-6e507c8cb41b0d48963503a88034348d74506211.tar.gz
Fill in undef as "(unchanged)" when displaying commits
and prefix the epoch name.
Diffstat (limited to 'lib/PublicInbox/AdminEdit.pm')
-rw-r--r--lib/PublicInbox/AdminEdit.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/PublicInbox/AdminEdit.pm b/lib/PublicInbox/AdminEdit.pm
index b27c831b..169feba0 100644
--- a/lib/PublicInbox/AdminEdit.pm
+++ b/lib/PublicInbox/AdminEdit.pm
@@ -47,4 +47,21 @@ sub check_editable ($) {
         }
 }
 
+# takes the output of V2Writable::purge and V2Writable::replace
+# $rewrites = [ array commits keyed by epoch ]
+sub show_rewrites ($$$) {
+        my ($fh, $ibx, $rewrites) = @_;
+        print $fh "$ibx->{mainrepo}:";
+        if (scalar @$rewrites) {
+                my $epoch = -1;
+                my @out = map {;
+                        ++$epoch;
+                        "$epoch.git: ".(defined($_) ? $_ : '(unchanged)')
+                } @$rewrites;
+                print $fh join("\n\t", '', @out), "\n";
+        } else {
+                print $fh " NONE\n";
+        }
+}
+
 1;