[Bps-public-commit] SD branch, master, updated. 0.70-14-g6357a0f
spang at bestpractical.com
spang at bestpractical.com
Sat Aug 29 23:29:38 EDT 2009
The branch, master has been updated
via 6357a0f6e3b2bed58fa5378c10067cca6f56fd67 (commit)
via 967157c51186cdd0d93e05ccc00c8fa33926a8d0 (commit)
via 7aa500791846dd7be650871c952c6518e344752b (commit)
via 1757aee005519591008033812ab5a45b99c34de7 (commit)
via d83c23dd2cabeca9bdccaf0391cf5e8b86c770ec (commit)
from e58130de8bf95ebdbcca3a690052d7ec67a7fc5b (commit)
Summary of changes:
lib/App/SD/CLI/Command/Help.pm | 2 +-
lib/App/SD/CLI/Command/Help/Config.pm | 2 +-
lib/App/SD/CLI/Command/Help/Search.pm | 31 ++++++++------
lib/App/SD/CLI/Command/Ticket/Update.pm | 6 ++-
lib/App/SD/ForeignReplica.pm | 11 +++--
t/03-update-ticket-with-editor.t | 68 ++++++++++++++++++++++++-------
t/scripts/ticket-update-editor.pl | 4 +-
7 files changed, 86 insertions(+), 38 deletions(-)
- Log -----------------------------------------------------------------
commit d83c23dd2cabeca9bdccaf0391cf5e8b86c770ec
Author: Christine Spang <spang at bestpractical.com>
Date: Sat Aug 29 07:15:57 2009 -0400
Some small cleanups in ForeignReplica.pm
diff --git a/lib/App/SD/ForeignReplica.pm b/lib/App/SD/ForeignReplica.pm
index e1147fb..aa76108 100644
--- a/lib/App/SD/ForeignReplica.pm
+++ b/lib/App/SD/ForeignReplica.pm
@@ -257,10 +257,11 @@ sub _set_uuid_for_remote_id {
sub _url_based_uuid_for_remote_ticket_id {
my $self = shift;
my $id = shift;
- return $self->uuid_for_url(
- $self->remote_url
- . $self->remote_uri_path_for_id( $id)
- );
+
+ return $self->uuid_for_url(
+ $self->remote_url
+ . $self->remote_uri_path_for_id( $id )
+ );
}
@@ -281,7 +282,7 @@ sub remote_id_for_uuid {
$ticket->load( $uuid_or_luid =~ /^\d+$/? 'luid': 'uuid', $uuid_or_luid )
or do {
warn "couldn't load ticket #$uuid_or_luid";
- return undef
+ return undef;
};
my $prop = $self->uuid . '-id';
commit 1757aee005519591008033812ab5a45b99c34de7
Author: Christine Spang <spang at bestpractical.com>
Date: Sat Aug 29 10:21:50 2009 -0400
Fix a help typo pointed out by Gerfried Fuchs
diff --git a/lib/App/SD/CLI/Command/Help/Search.pm b/lib/App/SD/CLI/Command/Help/Search.pm
index 6ecdd4b..46e4a3b 100644
--- a/lib/App/SD/CLI/Command/Help/Search.pm
+++ b/lib/App/SD/CLI/Command/Help/Search.pm
@@ -18,7 +18,7 @@ print <<EOF
expressions are Perl regexes.
${cmd}ticket search -- status!=closed summary =~ http
- List all tickets with a status that does match closed
+ List all tickets with a status that does not match closed
and a summary matching 'http'.
${cmd}ticket search --group owner
commit 7aa500791846dd7be650871c952c6518e344752b
Author: Christine Spang <spang at bestpractical.com>
Date: Sat Aug 29 11:04:04 2009 -0400
Further fixes/clarifications for search help.
diff --git a/lib/App/SD/CLI/Command/Help/Search.pm b/lib/App/SD/CLI/Command/Help/Search.pm
index 46e4a3b..efa7cf3 100644
--- a/lib/App/SD/CLI/Command/Help/Search.pm
+++ b/lib/App/SD/CLI/Command/Help/Search.pm
@@ -14,46 +14,49 @@ print <<EOF
Note that 'list' is an alias for 'search'.
${cmd}ticket search --regex abc
- List all tickets with content matching 'abc'. Regular
+ List all tickets with content (in any property) matching 'abc'. Regular
expressions are Perl regexes.
- ${cmd}ticket search -- status!=closed summary =~ http
- List all tickets with a status that does not match closed
- and a summary matching 'http'.
+ ${cmd}ticket search -- status!=closed summary =~ http
+ List all tickets with a status property that does not match closed and a
+ summary matching 'http'.
${cmd}ticket search --group owner
${cmd}ticket search -g owner
- List all tickets with a status that does not match 'closed',
+ List all tickets with a status property that does not match 'closed',
grouped by owner.
${cmd}ticket search --sort due
${cmd}ticket search -s due
- List all tickets with a status that does not match 'closed',
+ List all tickets with a status property that does not match 'closed',
sorted by due date.
${cmd}ticket basics 1234
Show basic information (metadata only) for the ticket with local id 1234.
${cmd}ticket show 1234
- Show basic information, comments, and history for the ticket with local
- id 1234. ('details' is an alias for 'show')
+ Show basic information and history and list attachments for the ticket
+ with local id 1234.
+
+ ${cmd}ticket details 1234
+ Show basic information, comments, and history, and list attachments for
+ the ticket with local id 1234.
${cmd}ticket show 1234 --all-props
${cmd}ticket show 1234 -a
Show all properties of the given ticket, even if they aren't in
the database setting common_ticket_props (or local configuration
- variable 'common_ticket_props' if it exists).
+ variable 'ticket.common_props' if it exists).
${cmd}ticket show 1234 --skip-history
${cmd}ticket show 1234 -s
- Show only metadata and comments for the ticket 1234 (but not
- history).
+ Show only metadata and a list of attachments for the ticket 1234 (but
+ not history).
${cmd}ticket show 1234 --with-history
${cmd}ticket show 1234 -h
- Override the disable_ticket_show_history_by_default config option
- if it is set for this database. (See '${cmd}help config' for
- more info.)
+ Override the ticket.no-implicit-history-display config option if it is
+ set for this replica. (See '${cmd}help config' for more info.)
${cmd}ticket history 1234
Show history for the ticket with local id 1234.
commit 967157c51186cdd0d93e05ccc00c8fa33926a8d0
Author: Christine Spang <spang at bestpractical.com>
Date: Sat Aug 29 11:57:58 2009 -0400
bugfix: be able to delete props that aren't in common_ticket_props from the editor
diff --git a/lib/App/SD/CLI/Command/Ticket/Update.pm b/lib/App/SD/CLI/Command/Ticket/Update.pm
index 0c970ec..dc6c366 100644
--- a/lib/App/SD/CLI/Command/Ticket/Update.pm
+++ b/lib/App/SD/CLI/Command/Ticket/Update.pm
@@ -66,7 +66,11 @@ sub process_template {
if (!exists $props_ref->{$prop} &&
# only delete props if they were actually presented
# for editing in the first place
- grep { $_ eq $prop } $record->props_to_show( { update => 1 } ) );
+ grep { $_ eq $prop } $record->props_to_show( {
+ update => 1,
+ verbose => $self->has_arg('all-props'),
+ } )
+ );
}
# don't add props that didn't change to the changeset
diff --git a/t/03-update-ticket-with-editor.t b/t/03-update-ticket-with-editor.t
index ab6a34d..c79ce53 100644
--- a/t/03-update-ticket-with-editor.t
+++ b/t/03-update-ticket-with-editor.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
-use Prophet::Test tests => 16;
+use Prophet::Test tests => 17;
use App::SD::Test;
BEGIN {
@@ -41,14 +41,18 @@ run_output_matches( 'sd', [ 'ticket', 'basics', '--batch', '--id', $ticket_id ],
]
);
-Prophet::Test->set_editor_script("ticket-update-editor.pl --no-args $replica_uuid $ticket_uuid");
+Prophet::Test->set_editor_script(
+ "ticket-update-editor.pl --no-args $replica_uuid $ticket_uuid");
# update it
-my ($comment_id, $comment_uuid) = App::SD::Test->update_ticket_with_editor_ok($ticket_id, $ticket_uuid);
+my ($comment_id, $comment_uuid)
+ = App::SD::Test->update_ticket_with_editor_ok($ticket_id, $ticket_uuid);
-# check output -- component prop should be hidden by common_ticket_props
-run_output_matches( 'sd', [ 'ticket', 'basics', '--batch', '--id', $ticket_id ],
+# check output -- component && foobar should be hidden by common_ticket_props
+run_output_matches( 'sd',
+ [ 'ticket', 'show', '--skip-history', '--batch', '--id', $ticket_id ],
[
+ '', '= METADATA', '',
"id: $ticket_id ($ticket_uuid)",
'summary: summary changed',
'status: new',
@@ -61,6 +65,26 @@ run_output_matches( 'sd', [ 'ticket', 'basics', '--batch', '--id', $ticket_id ],
]
);
+# check output with --all-props, need to use show instead of basics
+run_output_matches( 'sd',
+ [ 'ticket', 'show', '--batch', '--skip-history',
+ '--all-props', '--id', $ticket_id ],
+ [
+ '', '= METADATA', '',
+ "id: $ticket_id ($ticket_uuid)",
+ 'summary: summary changed',
+ 'status: new',
+ 'milestone: alpha',
+ qr/^created: \d{4}-\d{2}-\d{2}.+$/,
+ 'due: 2050-01-25 23:11:42',
+ qr/^creator: /,
+ 'reporter: ' . $ENV{PROPHET_EMAIL},
+ "original_replica: $replica_uuid",
+ qr/foobar: testing|component: core/, # no guaranteed ordering on props
+ qr/foobar: testing|component: core/, # not in common_ticket_props
+ ]
+);
+
sub check_comment_ok {
# comment output verifies that the template presented to the user for
# editing was correct
@@ -80,15 +104,21 @@ sub check_comment_ok {
check_comment_ok();
# sd ticket edit 20 --all-props
-Prophet::Test->set_editor_script("ticket-update-editor.pl --all-props $replica_uuid $ticket_uuid");
+Prophet::Test->set_editor_script(
+ "ticket-update-editor.pl --all-props $replica_uuid $ticket_uuid");
# update it
# template should show the hidden component prop
-($comment_id, $comment_uuid) = App::SD::Test->update_ticket_with_editor_ok($ticket_id, $ticket_uuid, '--all-props');
-
-# check output -- component prop should be hidden by common_ticket_props
-run_output_matches( 'sd', [ 'ticket', 'basics', '--batch', '--id', $ticket_id ],
+($comment_id, $comment_uuid)
+ = App::SD::Test->update_ticket_with_editor_ok($ticket_id,
+ $ticket_uuid, '--all-props');
+
+# check output
+run_output_matches( 'sd',
+ [ 'ticket', 'show', '--all-props',
+ '--skip-history', '--batch', '--id', $ticket_id ],
[
+ '', '= METADATA', '',
"id: $ticket_id ($ticket_uuid)",
'summary: now we are checking --all-props',
'status: new',
@@ -98,16 +128,20 @@ run_output_matches( 'sd', [ 'ticket', 'basics', '--batch', '--id', $ticket_id ]
qr/^creator: /,
'reporter: ' . $ENV{PROPHET_EMAIL},
"original_replica: $replica_uuid",
+ 'component: core',
]
);
check_comment_ok();
# sd ticket edit 20 --verbose
-Prophet::Test->set_editor_script("ticket-update-editor.pl --verbose $replica_uuid $ticket_uuid");
+Prophet::Test->set_editor_script(
+ "ticket-update-editor.pl --verbose $replica_uuid $ticket_uuid");
# update it
-($comment_id, $comment_uuid) = App::SD::Test->update_ticket_with_editor_ok($ticket_id, $ticket_uuid, '--verbose');
+($comment_id, $comment_uuid)
+ = App::SD::Test->update_ticket_with_editor_ok($ticket_id, $ticket_uuid,
+ '--verbose');
# check output -- component prop should be hidden by common_ticket_props
run_output_matches( 'sd', [ 'ticket', 'basics', '--batch', '--id', $ticket_id ],
@@ -127,7 +161,8 @@ run_output_matches( 'sd', [ 'ticket', 'basics', '--batch', '--id', $ticket_id ],
check_comment_ok();
# sd ticket edit 20 --verbose --all-props
-Prophet::Test->set_editor_script("ticket-update-editor.pl --verbose-and-all $replica_uuid $ticket_uuid");
+Prophet::Test->set_editor_script(
+ "ticket-update-editor.pl --verbose-and-all $replica_uuid $ticket_uuid");
diag('changing settings for regression test: make sure props aren\'t deleted');
diag('if they weren\'t presented for editing in the first place');
@@ -141,11 +176,14 @@ run_output_matches( 'sd', [ 'settings', '--set', '--', 'common_ticket_props',
);
# update it
-($comment_id, $comment_uuid) = App::SD::Test->update_ticket_with_editor_ok($ticket_id, $ticket_uuid, '--verbose', '--all-props');
+($comment_id, $comment_uuid)
+ = App::SD::Test->update_ticket_with_editor_ok($ticket_id, $ticket_uuid,
+ '--verbose', '--all-props');
# check output -- reporter prop should not have been deleted
# (need --verbose arg to check this)
-run_output_matches( 'sd', [ 'ticket', 'basics', '--batch', '--id', $ticket_id, '--verbose' ],
+run_output_matches( 'sd',
+ [ 'ticket', 'basics', '--batch', '--id', $ticket_id, '--verbose' ],
[
"id: $ticket_id ($ticket_uuid)",
'summary: now we are checking --verbose --all-props',
diff --git a/t/scripts/ticket-update-editor.pl b/t/scripts/ticket-update-editor.pl
index e53c3ee..68119c1 100755
--- a/t/scripts/ticket-update-editor.pl
+++ b/t/scripts/ticket-update-editor.pl
@@ -19,10 +19,12 @@ Prophet::Test::Editor::edit(
if ($option eq '--no-args') {
s/(?<=^summary: ).*$/summary changed/;
s/^owner:.*$//; # deleting a prop
- s/(?<=^due: ).*$/2050-01-25 23:11:42/; # adding a prop
+ # add a prop and an uncommon prop
+ s/(?<=^due: ).*$/2050-01-25 23:11:42\nfoobar: testing/;
} elsif ($option eq '--all-props') {
s/(?<=summary: ).*$/now we are checking --all-props/;
s/^due:.*//; # deleting a prop
+ s/^foobar:.*//; # deleting an uncommon prop
s/(?<=^owner: ).*$/$ENV{PROPHET_EMAIL}/; # adding a prop
} elsif ($option eq '--verbose') {
s/(?<=^summary: ).*$/now we are checking --verbose/;
commit 6357a0f6e3b2bed58fa5378c10067cca6f56fd67
Author: Christine Spang <spang at bestpractical.com>
Date: Sat Aug 29 12:06:57 2009 -0400
All help references for summary format should be 'ticket.summary-format'
diff --git a/lib/App/SD/CLI/Command/Help.pm b/lib/App/SD/CLI/Command/Help.pm
index b4441e1..5f21a57 100644
--- a/lib/App/SD/CLI/Command/Help.pm
+++ b/lib/App/SD/CLI/Command/Help.pm
@@ -54,7 +54,7 @@ ${cmd}help sync - Publishing and importing ticket databases
${cmd}help history - Viewing repository history
${cmd}help environment - Environment variables which affect sd
${cmd}help config - Local configuration variables
-${cmd}help ticket_summary_format - Details of this config variable
+${cmd}help ticket.summary_format - Details of this config variable
${cmd}help aliases - Command aliases
${cmd}help settings - Database configuration variables
diff --git a/lib/App/SD/CLI/Command/Help/Config.pm b/lib/App/SD/CLI/Command/Help/Config.pm
index 8d70167..f00a4d7 100644
--- a/lib/App/SD/CLI/Command/Help/Config.pm
+++ b/lib/App/SD/CLI/Command/Help/Config.pm
@@ -60,7 +60,7 @@ by configuration file section):
ticket.summary-format = %4s },\$luid | %-11.11s,status | %-60.60s,summary
Specifies how to format ticket summaries (when listing tickets, e.g.).
- (See also: help ticket-summary-format.)
+ (See also: '${cmd}help ticket.summary-format'.)
ticket.common-props = id,summary,status,owner,created,original_replica
A comma-separated list of ticket properties that are most-often
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list