[Bps-public-commit] SD branch, config-gitlike, updated. c5fb6bdee1001711f7114d908eff8363ab4f2639

jesse jesse at bestpractical.com
Tue Jul 7 16:30:48 EDT 2009


The branch, config-gitlike has been updated
       via  c5fb6bdee1001711f7114d908eff8363ab4f2639 (commit)
      from  d3ff5b53308276a700b6c74b910611c034df9c5e (commit)

Summary of changes:
 lib/App/SD/CLI/Command/Help/Config.pm   |    4 ++--
 lib/App/SD/CLI/Command/Ticket/Search.pm |    8 ++++----
 lib/App/SD/CLI/Command/Ticket/Show.pm   |    4 ++--
 lib/App/SD/Config.pm                    |    6 +++---
 t/06-ticket-show.t                      |   10 +++++-----
 t/07-sort-group.t                       |   12 ++++++------
 6 files changed, 22 insertions(+), 22 deletions(-)

- Log -----------------------------------------------------------------
commit c5fb6bdee1001711f7114d908eff8363ab4f2639
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Jul 7 16:30:39 2009 -0400

    config option rationalization - first pass

diff --git a/lib/App/SD/CLI/Command/Help/Config.pm b/lib/App/SD/CLI/Command/Help/Config.pm
index a00bdcd..dfeebb8 100644
--- a/lib/App/SD/CLI/Command/Help/Config.pm
+++ b/lib/App/SD/CLI/Command/Help/Config.pm
@@ -57,11 +57,11 @@ by configuration file section):
       creating or updating tickets. (Overrides the database-wide
       setting of the same name.)
 
-    ticket.list.default-sort = status
+    ticket.default-sort = status
       Bug property to determine order of display when displaying lists of
       tickets. (Can be any property; will be compared lexically.)
 
-    ticket.list.default-group = milestone
+    ticket.default-group = milestone
       Bug property to group tickets by when displaying lists of tickets. (Can
       be any property.)
 
diff --git a/lib/App/SD/CLI/Command/Ticket/Search.pm b/lib/App/SD/CLI/Command/Ticket/Search.pm
index 4444f00..c74fd95 100644
--- a/lib/App/SD/CLI/Command/Ticket/Search.pm
+++ b/lib/App/SD/CLI/Command/Ticket/Search.pm
@@ -10,20 +10,20 @@ sub run {
     my $self = shift;
 
     if (  (!$self->has_arg('sort') || !$self->arg('sort'))
-        && $self->app_handle->config->get( key => 'ticket.list.default-sort') )
+        && $self->app_handle->config->get( key => 'ticket.default-sort') )
     {
         $self->set_arg(
             'sort' => $self->app_handle->config->get(
-                key => 'ticket.list.default-sort'
+                key => 'ticket.default-sort'
             )
         );
     }
 
     if (  (!$self->has_arg('group') || !$self->arg('group'))
-        && $self->app_handle->config->get( key => 'ticket.list.default-group') )
+        && $self->app_handle->config->get( key => 'ticket.default-group') )
     {
         $self->set_arg( 'group' =>
-              $self->app_handle->config->get( key => 'ticket.list.default-group') );
+              $self->app_handle->config->get( key => 'ticket.default-group') );
     }
 
     # sort output by given prop if user specifies --sort
diff --git a/lib/App/SD/CLI/Command/Ticket/Show.pm b/lib/App/SD/CLI/Command/Ticket/Show.pm
index a2c824b..4d00967 100644
--- a/lib/App/SD/CLI/Command/Ticket/Show.pm
+++ b/lib/App/SD/CLI/Command/Ticket/Show.pm
@@ -46,11 +46,11 @@ override run => sub {
     }
 
     # allow user to not display history by specifying the --skip-history
-    # arg or setting ticket.show.disable-history config item to a
+    # arg or setting ticket.no-implicit-history-display config item to a
     # true value (can be overridden with --with-history)
     if (!$self->has_arg('skip-history')
         && (  !$self->app_handle->config->get(
-                key => 'ticket.show.disable-history',
+                key => 'ticket.no-implicit-history-display',
                 as => 'bool',
             ) || $self->has_arg('with-history') )
         )
diff --git a/lib/App/SD/Config.pm b/lib/App/SD/Config.pm
index 6d3832d..cee9f17 100644
--- a/lib/App/SD/Config.pm
+++ b/lib/App/SD/Config.pm
@@ -68,12 +68,12 @@ override load => sub  {
 # migrated from old to new.
 our %KEYS_CONVERSION_TABLE = (
     'email_address' => 'user.email-address',
-    'default_group_ticket_list' => 'ticket.list.default-group',
-    'default_sort_ticket_list' => 'ticket.list.default-sort',
+    'default_group_ticket_list' => 'ticket.default-group',
+    'default_sort_ticket_list' => 'ticket.default-sort',
     'summary_format_ticket' => 'ticket.summary-format',
     'default_summary_format' => 'record.summary-format',
     'common_ticket_props' => 'ticket.common-props',
-    'disable_ticket_show_history_by_default' => 'ticket.show.disable-history',
+    'disable_ticket_show_history_by_default' => 'ticket.no-implicit-history-display',
 );
 
 
diff --git a/t/06-ticket-show.t b/t/06-ticket-show.t
index 7a819a9..05056f0 100644
--- a/t/06-ticket-show.t
+++ b/t/06-ticket-show.t
@@ -95,23 +95,23 @@ check_output_without_history('--skip-history');
 my $config_filename = $ENV{'SD_REPO'} . '/config';
 Prophet::Util->write_file(
     file => $config_filename, content => '
-[ticket "show"]
-    disable-history = true
+[ticket]
+    no-implicit-history-display = true
 ');
 $ENV{'SD_CONFIG'} = $config_filename;
 
-diag("config option ticket.show.disable-history set");
+diag("config option no-implicit-history-display set");
 diag("(shouldn't show history)");
 
 check_output_without_history();
 
-diag("config option ticket.show.disable-history set");
+diag("config option no-implicit-history-display set");
 diag("and --skip-history passed (shouldn't show history)");
 
 check_output_without_history('--skip-history');
 
 # config option set and --with-history passed (should show history)
-diag('config option ticket.show.disable-history set');
+diag('config option no-implicit-history-display set');
 diag('and --with-history passed (should show history)');
 
 check_output_with_history('--with-history');
diff --git a/t/07-sort-group.t b/t/07-sort-group.t
index bdf4123..a24469a 100644
--- a/t/07-sort-group.t
+++ b/t/07-sort-group.t
@@ -42,12 +42,12 @@ run_output_matches( 'sd', [ 'ticket', 'list', '--sort', 'owner' ],
 my $config_filename = $ENV{'SD_REPO'} . '/config';
 Prophet::Util->write_file(
     file => $config_filename, content => '
-[ticket "list"]
+[ticket]
     default-sort = owner
 ');
 $ENV{'SD_CONFIG'} = $config_filename;
 
-diag('using ticket.list.default-sort = owner');
+diag('using ticket.default-sort = owner');
 run_output_matches( 'sd', [ 'ticket', 'list' ],
     [ qr/(\d+) huzzah! new/,
       qr/(\d+) YATTA new/,
@@ -61,7 +61,7 @@ run_output_matches( 'sd', [ 'ticket', 'list', '--sort' ],
     ]
 );
 
-diag('using ticket.list.default-sort = owner and --sort none');
+diag('using ticket.default-sort = owner and --sort none');
 run_output_matches( 'sd', [ 'ticket', 'list', '--sort', 'none' ],
     [ qr/(\d+) YATTA new/,
       qr/(\d+) huzzah! new/,
@@ -85,10 +85,10 @@ run_output_matches( 'sd', [ 'ticket', 'list', '--group', 'owner' ],
     ]
 );
 
-diag('using ticket.search.default-group = owner');
+diag('using ticket.default-group = owner');
 Prophet::Util->write_file(
     file => $config_filename, content => '
-[ticket "list"]
+[ticket]
     default-group = owner
 ');
 
@@ -121,7 +121,7 @@ run_output_matches( 'sd', [ 'ticket', 'list', '--group' ],
     ]
 );
 
-diag('using ticket.list.default-group = owner and --group none');
+diag('using ticket.default-group = owner and --group none');
 run_output_matches( 'sd', [ 'ticket', 'list', '--group', 'none' ],
     [ qr/(\d+) YATTA new/,
       qr/(\d+) huzzah! new/,

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list