summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
eb397a9)
This allows avoiding 404s when trying _/text/config/raw on code
repositories.
repositories matching the given wildcard pattern. Supports the same
wildcards as L</--include>
repositories matching the given wildcard pattern. Supports the same
wildcards as L</--include>
+=item --inbox-config=always|v2|v1|never
+
+Whether or not to retrieve the C<$INBOX/_/text/config/raw> HTTP(S)
+endpoint when cloning.
+
+Since we can't deduce v1 inboxes from code repositories, setting this
+to C<v2> or C<never> can allow faster clones of code repositories if
+no v1 inboxes are present.
+
+Default: C<always>
+
push @$cmd, '--reference', "$self->{dst}$ref";
start_clone($self, $cmd, $opt, $fini);
push @$cmd, '--reference', "$self->{dst}$ref";
start_clone($self, $cmd, $opt, $fini);
- _get_txt_start($self, '_/text/config/raw', $fini);
+ $lei->{opt}->{'inbox-config'} =~ /\A(?:always|v1)\z/s and
+ _get_txt_start($self, '_/text/config/raw', $fini);
my $d = $self->{-ent} ? $self->{-ent}->{description} : undef;
defined($d) ? ($self->{'txt.description'} = $d) :
_get_txt_start($self, 'description', $fini);
my $d = $self->{-ent} ? $self->{-ent}->{description} : undef;
defined($d) ? ($self->{'txt.description'} = $d) :
_get_txt_start($self, 'description', $fini);
my $lk = bless { lock_path => "$dst/inbox.lock" }, 'PublicInbox::Lock';
my $fini = PublicInbox::OnDestroy->new($$, \&v2_done, $task);
my $lk = bless { lock_path => "$dst/inbox.lock" }, 'PublicInbox::Lock';
my $fini = PublicInbox::OnDestroy->new($$, \&v2_done, $task);
- _get_txt_start($task, '_/text/config/raw', $fini);
+ $lei->{opt}->{'inbox-config'} =~ /\A(?:always|v2)\z/s and
+ _get_txt_start($task, '_/text/config/raw', $fini);
+
_get_txt_start($self, 'description', $fini);
$task->{-locked} = $lk->lock_for_scope($$) if !$self->{dry_run};
_get_txt_start($self, 'description', $fini);
$task->{-locked} = $lk->lock_for_scope($$) if !$self->{dry_run};
die "TODO: non-HTTP/HTTPS clone of $self->{src} not supported, yet";
}
die "TODO: non-HTTP/HTTPS clone of $self->{src} not supported, yet";
}
-sub do_mirror { # via wq_io_do
+sub do_mirror { # via wq_io_do or public-inbox-clone
my ($self) = @_;
my $lei = $self->{lei};
umask($lei->{client_umask}) if defined $lei->{client_umask};
eval {
my ($self) = @_;
my $lei = $self->{lei};
umask($lei->{client_umask}) if defined $lei->{client_umask};
eval {
+ my $ic = $lei->{opt}->{'inbox-config'} //= 'always';
+ $ic =~ /\A(?:v1|v2|always|never)\z/s or die <<"";
+--inbox-config must be one of `always', `v2', `v1', or `never'
+
my $iv = $lei->{opt}->{'inbox-version'};
if (defined $iv) {
local $LIVE;
my $iv = $lei->{opt}->{'inbox-version'};
if (defined $iv) {
local $LIVE;
-C DIR chdir to specified directory
EOF
GetOptions($opt, qw(help|h quiet|q verbose|v+ C=s@ c=s@ include|I=s@ exclude=s@
-C DIR chdir to specified directory
EOF
GetOptions($opt, qw(help|h quiet|q verbose|v+ C=s@ c=s@ include|I=s@ exclude=s@
dry-run|n jobs|j=i no-torsocks torsocks=s epoch=s)) or die $help;
if ($opt->{help}) { print $help; exit };
require PublicInbox::Admin; # loads Config
dry-run|n jobs|j=i no-torsocks torsocks=s epoch=s)) or die $help;
if ($opt->{help}) { print $help; exit };
require PublicInbox::Admin; # loads Config