a slew of adc changes; details below:

- get_rights_and_owner normalises its arg1 by stripping .git if
    supplied, then sets the variable "repo" to the result as a side
    effect
  - new "help" adc with some default text but main purpose is to allow
    site local help text
  - other adc's refer to 'help' adc when appropriate
  - 'undelete' renamed to 'restore'; that's what the KDE "trashcan"
    program calls that operation
  - minor typo in sample script in documentation
  - main adc doc points to contrib/adc/repo-deletion.README now
This commit is contained in:
Sitaram Chamarty 2010-10-27 23:08:58 +05:30
parent 9fc521930d
commit 5b3dcb3757
12 changed files with 66 additions and 27 deletions

View file

@ -26,9 +26,8 @@ opt() {
valid_owned_repo() {
# check that an arg passed is a valid repo and the current user owns it
repo=$1
[ -z "$1" ] && die need a repo name
get_rights_and_owner $repo
get_rights_and_owner $1
[ "$owner" = "$GL_USER" ] || die "$repo does not exist or is not yours!"
# and we sneak this in too, quietly :)
@ -37,9 +36,11 @@ valid_owned_repo() {
die() { echo "$@"; exit 1; }
# NOTE: this also sets $repo to the normalised (without .git suffix) reponame
get_rights_and_owner() {
local ans
ans=$(perl -I$GL_BINDIR -Mgitolite -e 'cli_repo_rights("'$1'")')
repo=${1%.git}
ans=$(perl -I$GL_BINDIR -Mgitolite -e 'cli_repo_rights("'$repo'")')
# set shell variables as needed
owner=${ans#* }