+sub dump_project_list ($$) {
+ my ($self, $m) = @_;
+ my $f = $self->{'-project-list'} // return;
+ my $old = PublicInbox::Git::try_cat($f);
+ my %new;
+
+ open my $dh, '<', '.' or die "open(.): $!";
+ chdir($self->{dst}) or die "chdir($self->{dst}): $!";
+ my @local = grep { -e $_ ? ($new{$_} = undef) : 1 } split(/\n/s, $old);
+ chdir($dh) or die "chdir(restore): $!";
+
+ $new{substr($_, 1)} = 1 for keys %$m; # drop leading '/'
+ my @list = sort keys %new;
+ my @remote = grep { !defined($new{$_}) } @list;
+ my %lnk = map { substr($_, 1) => undef } @{$self->{-new_symlinks}};
+ @remote = grep { !exists($lnk{$_}) } @remote;
+
+ warn <<EOM if @remote;
+The following local repositories are ignored/gone from $self->{src}:
+EOM
+ warn "\t", $_, "\n" for @remote;
+ warn <<EOM if @local;
+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);
+ $self->{chg}->{nr_chg} += scalar(@remote) + scalar(@local);
+ my $new = join("\n", @list, '');
+ atomic_write($dn, $bn, $new) if $new ne $old;
+}
+