From 741512482bf1b3e03fb4302e05cace1b7b92e143 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Tue, 20 Mar 2012 07:43:20 +0530 Subject: [PATCH] 'info' learned not to show ^C column when used with '-p' --- src/commands/info | 6 +++++- t/info.t | 48 +++++++++++++++++++++++------------------------ t/sequence.t | 8 ++++---- 3 files changed, 33 insertions(+), 29 deletions(-) diff --git a/src/commands/info b/src/commands/info index b3744e3..0c503e1 100755 --- a/src/commands/info +++ b/src/commands/info @@ -53,12 +53,15 @@ my $lr = lister_dispatch('list-repos'); my $perm; my $repos; +my @aa; if ($phy) { _chdir( $rc{GL_REPO_BASE} ); $repos = list_phy_repos(1); + @aa = qw(R W); } else { $repos = $lr->(); + @aa = qw(R W ^C); } my $creator = ''; @@ -66,7 +69,8 @@ for my $repo (@$repos) { next unless $repo =~ /$patt/; my $perm = ''; $creator = creator($repo) if $lc; - for my $aa (qw(R W ^C)) { + + for my $aa (@aa) { my $ret = access( $repo, $user, $aa, $ref ); $perm .= ( $ret =~ /DENIED/ ? " " : " $aa" ); } diff --git a/t/info.t b/t/info.t index 1a1cd69..7844fa5 100755 --- a/t/info.t +++ b/t/info.t @@ -71,33 +71,33 @@ try " try " glt info u1 -p; ok; GS u1 - /R W \tt1/ - /R \tt2/ - /R W \ttesting/ - !/R W \tt3/ + /R W *\tt1/ + /R *\tt2/ + /R W *\ttesting/ + !/R W *\tt3/ glt info u2 -p; ok; GS u2 - /R \tt1/ - /R W \tt2/ - /R W \ttesting/ - !/R W \tt3/ + /R *\tt1/ + /R W *\tt2/ + /R W *\ttesting/ + !/R W *\tt3/ glt info u3 -p; ok; GS u3 - /R W \tt3/ - /R W \ttesting/ - !/R \tt1/ - !/R W \tt2/ + /R W *\tt3/ + /R W *\ttesting/ + !/R *\tt1/ + !/R W *\tt2/ glt info u4 -p; ok; GS u4 - /R \tt3/ - /R W \ttesting/ - !/R \tt1/ - !/R W \tt2/ + /R *\tt3/ + /R W *\ttesting/ + !/R *\tt1/ + !/R W *\tt2/ glt info u5 -p; ok; GS u5 - /R W \ttesting/ - !/R \tt1/ - !/R W \tt2/ - !/R W \tt3/ + /R W *\ttesting/ + !/R *\tt1/ + !/R W *\tt2/ + !/R W *\tt3/ glt info u6 -p; ok; GS u6 - /R W \ttesting/ - !/R \tt1/ - !/R W \tt2/ - !/R W \tt3/ + /R W *\ttesting/ + !/R *\tt1/ + !/R W *\tt2/ + !/R W *\tt3/ "; diff --git a/t/sequence.t b/t/sequence.t index 85be29a..f88348a 100755 --- a/t/sequence.t +++ b/t/sequence.t @@ -38,8 +38,8 @@ try " /WRITERS u2/ # expand glt info u2 -p - /R W \tfoo/u1/bar/ - /R W \ttesting/ + /R W *\tfoo/u1/bar/ + /R W *\ttesting/ # push cd .. @@ -81,8 +81,8 @@ try " /WRITERS u2/ # expand glt info u2 -p - /R W \tfoo/u1/bar/ - /R W \ttesting/ + /R W *\tfoo/u1/bar/ + /R W *\ttesting/ # push cd ..