Wednesday 12 March 2014

understaning svn hook 1

understaning svn hook 1

# svnlook is one of the most required command to create the svn hooks, so that you can get more information about your checkin...

# Here is an example hook script, for a Unix /bin/sh interpreter.
# For more examples and pre-written hooks, see those in
# the Subversion repository at
# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/


REPOS="$1"
TXN="$2"

# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
$SVNLOOK log -t "$TXN" "$REPOS" | \
   grep "[a-zA-Z0-9]" > /dev/null || exit 1

# Check that the author of this commit has the rights to perform
# the commit on the files and directories being modified.
commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1

# All checks passed, so allow the commit.
exit 0


svnlook --help
general usage: svnlook SUBCOMMAND REPOS_PATH [ARGS & OPTIONS ...]
Note: any subcommand which takes the '--revision' and '--transaction'
      options will, if invoked without one of those options, act on
      the repository's youngest revision.
Type 'svnlook help <subcommand>' for help on a specific subcommand.
Type 'svnlook --version' to see the program version and FS modules.

Available subcommands:
   author
   cat
   changed
   date
   diff
   dirs-changed
   help (?, h)
   history
   info
   lock
   log
   propget (pget, pg)
   proplist (plist, pl)
   tree
   uuid
   youngest
 

svnlook help cat

# The above command will give you how to use the sub-command:

cat: usage: svnlook cat REPOS_PATH FILE_PATH

Print the contents of a file.  Leading '/' on FILE_PATH is optional.

Valid options:
  -r [--revision] ARG      : specify revision number ARG
  -t [--transaction] ARG   : specify transaction name ARG





No comments:

Post a Comment