[Bps-public-commit] r15176 - in Pushmi/trunk: . Pushmi-Admin/lib/Pushmi/Admin Pushmi-Admin/lib/Pushmi/Admin/Action Pushmi-Admin/lib/Pushmi/Admin/Model Pushmi-Admin/share/web/static/css
alexmv at bestpractical.com
alexmv at bestpractical.com
Thu Aug 14 18:48:59 EDT 2008
Author: alexmv
Date: Thu Aug 14 18:48:59 2008
New Revision: 15176
Modified:
Pushmi/trunk/ (props changed)
Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin.pm
Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Action/Sync.pm
Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Model/Replica.pm
Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/View.pm
Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css
Log:
r35990 at kohr-ah: chmrr | 2008-08-14 18:48:52 -0400
* Bootstrap improvements in UI, as well as detecting svk:dump-url
* More bulletproofing of trailing slashes in svn urls
Modified: Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin.pm
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin.pm (original)
+++ Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin.pm Thu Aug 14 18:48:59 2008
@@ -15,6 +15,7 @@
sub svn_info_for {
my $class = shift;
my ($url) = @_;
+ $url =~ s{/+$}{};
my $memcached = $Jifty::DBI::Record::Memcached::MEMCACHED;
my $props = $memcached->get( $url );
Modified: Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Action/Sync.pm
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Action/Sync.pm (original)
+++ Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Action/Sync.pm Thu Aug 14 18:48:59 2008
@@ -15,7 +15,7 @@
param bootstrap =>
type is 'text',
- label is "Bootstrap file", ajax validates;
+ label is "Bootstrap URL", ajax validates;
param replica =>
type is 'integer',
Modified: Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Model/Replica.pm
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Model/Replica.pm (original)
+++ Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Model/Replica.pm Thu Aug 14 18:48:59 2008
@@ -197,6 +197,14 @@
return $self->file_root( "svn" );
}
+sub remote_bootstrap {
+ my $self = shift;
+ my ($baton, $ref) = SVN::Core::auth_open_helper(undef); # XXX Auth
+ my $ra = SVN::Ra->new( url => $self->url, config => undef, auth => $baton);
+ my $data = [$ra->get_file('', $ra->get_latest_revnum, undef)];
+ return $data->[1]{'svk:dump-url'} || '';
+}
+
sub cache {
my $self = shift;
return $self->{cache} if $self->{cache};
Modified: Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/View.pm
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/View.pm (original)
+++ Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/View.pm Thu Aug 14 18:48:59 2008
@@ -76,7 +76,8 @@
)
);
- my $data = Pushmi::Admin->svn_info_for( $new->argument_value("url") );
+ my $url = $new->argument_value('url'); $url =~ s{/+$}{};
+ my $data = Pushmi::Admin->svn_info_for( $url );
div {
{ class is 'roundbox' };
h2 {"Add a new replica"};
@@ -84,7 +85,7 @@
div {
{ class is 'replica' };
h3 { $new->argument_value("name") };
- hyperlink( url => $new->argument_value("url"), label => $new->argument_value("url") );
+ hyperlink( url => $url, label => $url );
};
div { { class is 'create master health'};
@@ -167,19 +168,27 @@
. " revisions from the remote mirror. This may take some time!";
};
+ p {
+ "If you have a bootstrap file for this mirror, you can
+ provide a URL to it below, which will significantly
+ speed up the process.";
+ };
+
+ if ($replica->remote_revision >= 1000) {
+ p { { class is "warning" }
+ "There are enough remote revisions that attempting to mirror them "
+ ."without a bootstrap file is fairly infeasable. You can try it, but "
+ ."be aware that is unlikely to work.";
+ };
+ }
+
form {
my $sync = Jifty->web->new_action( class => "Sync", );
render_param(
$sync => "replica" => default_value => $replica->id );
- p {
- "If you have a bootstrap file for this mirror, you can
- provide a URL to it below, which will significantly
- speed up the process.";
- };
-
render_param(
- $sync => "bootstrap" );
+ $sync => "bootstrap" => default_value => $replica->remote_bootstrap );
form_submit( label => "Start mirroring", onclick => {submit => $sync}, class => "replica sync" );
}
Modified: Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css (original)
+++ Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css Thu Aug 14 18:48:59 2008
@@ -90,6 +90,18 @@
padding: 0.5em;
}
+.warning {
+ background-color: #211;
+ color: #c00;
+ -moz-border-radius: 5px; -webkit-border-radius: 5px;
+ border: 1px solid #c00;
+ padding: 0.5em;
+ padding-left: 2.5em;
+ background-repeat: no-repeat;
+ background-position: 15px 10px;
+ background-image: url(/static/images/silk/error.png);
+}
+
/* Rounded boxes and titles */
.roundbox {
@@ -208,6 +220,21 @@
float: right;
}
+.submit_button input {
+ margin-left: 4em;
+}
+
+input.argument-bootstrap {
+ margin-left: 4em;
+ width: 350px;
+}
+
+div.argument-bootstrap label.argument-bootstrap {
+ margin-left: 4em;
+ float: none;
+ width: 100%;
+}
+
/* Log display */
.logwindow {
@@ -222,7 +249,7 @@
.progressbar {
text-align: center;
display: block;
- margin: 1em 0;
+ margin-top: 1em;
}
More information about the Bps-public-commit
mailing list