lockcachestale.pl #1

  • //
  • guest/
  • paul_goffin/
  • triggers/
  • lockcachestale.pl
  • View
  • Commits
  • Open Download .zip Download (557 B)
#
# Set the cache stale counter for the branch lock trigger.
# Unix usage:
#	perl /whatever/Lockbranchstale.pl %changelist% %serverport%
# NT usage:
#       c:/perl/bin/perl  c:/whatever/lockbranchstale.pl %changelist% %serverport%
# (Note that the name of this script might need to be an "8.3" filename,
# depending on the version of Perl you're running.)
#
# Tested on Platforms:    NT (as program, not service).
#

$ChangeNum = $ARGV[0];
$ServerPort = $ARGV[1];
$p4 = "p4 -p $ServerPort -u <review_user>";

`$p4 counter lockchange $ChangeNum`;

exit (0);
# Change User Description Committed
#1 309 paul_goffin lockbranch trigger (and companion lockcachestale)

Triggers to allow ordinary (non-super) users to lock
branches of the depot against submissions without needing
access to `p4 protect`.

Users just add text files to a `well-known` place,
(say //depot/locks/*) these files contain lists
of depot paths that submissions should be
refused from.

I suggest each project leader is given permission
to set up a single file - say a file named
with their own name (or user name) and all
other users are prevented from changing files
in the //depot/locks area - that way you should
avoid unintentional denial-of-service events!

Obviously using these locks is slower than
the "protect" system, but it is useful when the
admin is too busy to add the lock.