Permalink
Browse files

'writes' -> 'writable', order of arguments changed

  • Loading branch information...
1 parent cc8b104 commit 2bec5510095678e907962431a011c49cae6fe986 @sitaramc committed Mar 27, 2012
Showing with 12 additions and 13 deletions.
  1. +2 −2 src/Gitolite/Rc.pm
  2. +3 −4 src/commands/{writes → writable}
  3. +1 −1 t/glt
  4. +6 −6 t/{writes.t → writable.t}
View
@@ -94,7 +94,7 @@ $ENV{PATH} = "$ENV{GL_BINDIR}:$ENV{PATH}";
}
# these two are meant to help externally written commands (see
-# src/commands/writes for an example)
+# src/commands/writable for an example)
$ENV{GL_REPO_BASE} = $rc{GL_REPO_BASE};
$ENV{GL_ADMIN_BASE} = $rc{GL_ADMIN_BASE};
@@ -282,7 +282,7 @@ __DATA__
'info' => 1,
'desc' => 1,
'perms' => 1,
- 'writes' => 1,
+ 'writable' => 1,
},
# comment out or uncomment as needed
@@ -6,7 +6,7 @@ use lib $ENV{GL_BINDIR};
use Gitolite::Easy;
=for usage
-Usage: gitolite writes on|off <reponame>|@all
+Usage: gitolite writable <reponame>|@all on|off
'on' enables, 'off' disables, writes (pushes) to the named repo or all repos.
@@ -16,11 +16,10 @@ from STDIN; this allows longer messages.
=cut
usage() if not @ARGV or @ARGV < 2 or $ARGV[0] eq '-h';
-
-usage() if $ARGV[0] ne 'on' and $ARGV[0] ne 'off';
-my $on = ( shift eq 'on' );
+usage() if $ARGV[1] ne 'on' and $ARGV[1] ne 'off';
my $repo = shift;
+my $on = ( shift eq 'on' );
if ( $repo eq '@all' ) {
die "you are not authorized\n" if $ENV{GL_USER} and not is_admin();
View
2 t/glt
@@ -14,7 +14,7 @@ my %extcmds = (
info => 1,
desc => 1,
perms => 1,
- writes => 1,
+ writable => 1,
);
$ENV{G3T_USER} = $user;
@@ -8,7 +8,7 @@ use Gitolite::Test;
use Cwd;
my $workdir = getcwd();
-# 'gitolite writes' command
+# 'gitolite writable' command
# ----------------------------------------------------------------------
my $sf = ".gitolite.down";
@@ -48,7 +48,7 @@ try "
PUSH u2 master; ok;
# disable site with some message
- gitolite writes off \@all testing site-wide disable; ok
+ gitolite writable \@all off testing site-wide disable; ok
# try push foo and see fail + message
cd ../foo; ok
@@ -67,7 +67,7 @@ try "
cd u4; ok
# enable site
- gitolite writes on \@all; ok
+ gitolite writable \@all on; ok
# try same 3 again
@@ -88,7 +88,7 @@ try "
cd u6; ok
# disable just foo
- gitolite writes off foo foo down
+ gitolite writable foo off foo down
# try push foo and see the message
cd ../foo; ok
@@ -101,8 +101,8 @@ try "
PUSH u2; ok; /master -> master/
# enable foo, disable bar/u2
- gitolite writes on foo
- gitolite writes off bar/u2 the bar is closed
+ gitolite writable foo on
+ gitolite writable bar/u2 off the bar is closed
# try both
cd ../foo; ok

0 comments on commit 2bec551

Please sign in to comment.