From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 2/3] clone: show stale directories unconditionally
Date: Sat, 18 Mar 2023 12:02:12 +0000 [thread overview]
Message-ID: <20230318120213.1461990-3-e@80x24.org> (raw)
In-Reply-To: <20230318120213.1461990-1-e@80x24.org>
--project-list= is no longer required to show stale
repositories.
---
lib/PublicInbox/LeiMirror.pm | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm
index c8d28eba..8b7e48ab 100644
--- a/lib/PublicInbox/LeiMirror.pm
+++ b/lib/PublicInbox/LeiMirror.pm
@@ -1089,8 +1089,8 @@ sub dump_manifest ($$) {
sub dump_project_list ($$) {
my ($self, $m) = @_;
- my $f = $self->{'-project-list'} // return;
- my $old = PublicInbox::Git::try_cat($f);
+ my $f = $self->{'-project-list'};
+ my $old = defined($f) ? PublicInbox::Git::try_cat($f) : '';
my %new;
open my $dh, '<', '.' or die "open(.): $!";
@@ -1108,13 +1108,15 @@ sub dump_project_list ($$) {
The following local repositories are ignored/gone from $self->{src}:
EOM
warn "\t", $_, "\n" for @remote;
- warn <<EOM if @local;
+ if (defined($f) && @local) {
+ warn <<EOM;
The following repos in $f no longer exist on the filesystem:
EOM
- warn "\t", $_, "\n" for @local;
-
- my (undef, $dn, $bn) = File::Spec->splitpath($f);
+ warn "\t", $_, "\n" for @local;
+ }
$self->{chg}->{nr_chg} += scalar(@remote) + scalar(@local);
+ $f // return;
+ my (undef, $dn, $bn) = File::Spec->splitpath($f);
my $new = join("\n", @list, '');
atomic_write($dn, $bn, $new) if $new ne $old;
}
next prev parent reply other threads:[~2023-03-18 12:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-18 12:02 [PATCH 0/3] clone: support --purge + doc updates Eric Wong
2023-03-18 12:02 ` [PATCH 1/3] doc: clone: note the default value of --remote-manifest= Eric Wong
2023-03-18 12:02 ` Eric Wong [this message]
2023-03-18 12:02 ` [PATCH 3/3] clone: support --purge to delete remotely-deleted repos Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230318120213.1461990-3-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).