From 1b1b00a10c2cca8c0460b8731c445098e870da1b Mon Sep 17 00:00:00 2001 From: Thomas Keller Date: Sat, 4 Jun 2011 23:15:58 +0200 Subject: [PATCH] The server list no longer renders a bogus server entry in case no monotone server has been configured yet in the connected usher instance. Also display a short info text if the server or connection list for a running monotone server is empty. --- NEWS.mdtext | 3 +++ src/IDF/Scm/Monotone/Usher.php | 4 ++-- src/IDF/templates/idf/gadmin/usher/connections.html | 6 ++++++ src/IDF/templates/idf/gadmin/usher/index.html | 6 ++++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/NEWS.mdtext b/NEWS.mdtext index 6add8ed..703336e 100644 --- a/NEWS.mdtext +++ b/NEWS.mdtext @@ -17,6 +17,9 @@ - Fix SSH public key parsing issues and improve the check for existing, uploaded keys (issue 679) - Diff views now show empty context lines for git and hg again (issue 688) - Let the SVN command line client not store the login credentials we give him as arguments +- The usher section in the forge administration no longer displays a bogus + server enty in case no monotone server is configured in the connected + usher instance ## Documentation diff --git a/src/IDF/Scm/Monotone/Usher.php b/src/IDF/Scm/Monotone/Usher.php index 614a94f..bbe4704 100644 --- a/src/IDF/Scm/Monotone/Usher.php +++ b/src/IDF/Scm/Monotone/Usher.php @@ -48,7 +48,7 @@ class IDF_Scm_Monotone_Usher if ($conn == 'none') return array(); - return preg_split('/[ ]/', $conn); + return preg_split('/[ ]/', $conn, -1, PREG_SPLIT_NO_EMPTY); } /** @@ -73,7 +73,7 @@ class IDF_Scm_Monotone_Usher if ($conn == 'none') return array(); - $single_conns = preg_split('/[ ]/', $conn); + $single_conns = preg_split('/[ ]/', $conn, -1, PREG_SPLIT_NO_EMPTY); $ret = array(); foreach ($single_conns as $conn) { preg_match('/\((\w+)\)([^:]+):(\d+)/', $conn, $matches); diff --git a/src/IDF/templates/idf/gadmin/usher/connections.html b/src/IDF/templates/idf/gadmin/usher/connections.html index bde9e2f..8af6f60 100644 --- a/src/IDF/templates/idf/gadmin/usher/connections.html +++ b/src/IDF/templates/idf/gadmin/usher/connections.html @@ -8,12 +8,18 @@ {trans "address"} {trans "port"} +{if count($connections) == 0} + + {trans 'No connections found.'} + +{else} {foreach $connections as $connection} {$connection.address} {$connection.port} {/foreach} +{/if} {/block} diff --git a/src/IDF/templates/idf/gadmin/usher/index.html b/src/IDF/templates/idf/gadmin/usher/index.html index fa6041b..9232765 100644 --- a/src/IDF/templates/idf/gadmin/usher/index.html +++ b/src/IDF/templates/idf/gadmin/usher/index.html @@ -9,6 +9,11 @@ {trans "status"} {trans "action"} +{if count($servers) == 0} + + {trans 'No monotone servers configured.'} + +{else} {foreach $servers as $server} {$server.name} @@ -31,6 +36,7 @@ {/if} {/foreach} +{/if} {/block}