From 94bff5afcc673da0cd23cfc07f8cdda808d20d9a Mon Sep 17 00:00:00 2001 From: HEBERT Alain Date: Thu, 18 Sep 2025 08:59:44 -0400 Subject: Resolve "Reduce multicompo size for two Donjon non-regression tests" --- script/pre-commit | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100755 script/pre-commit (limited to 'script/pre-commit') diff --git a/script/pre-commit b/script/pre-commit deleted file mode 100755 index 2d9e8b9..0000000 --- a/script/pre-commit +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/python3 -""" -Subversion pre-commit hook which currently checks that the card-index -information is consistent and correctly given. -""" -#Author: Alain Hebert, Ecole Polytechnique, 2006. - -import os, sys, pysvn - -def main(repos, txn): - # Recover the transaction data: - print("pre-commit: repos=",repos) - t = pysvn.Transaction( repos, txn ) - all_props = t.revproplist() - message = t.revproplist()['svn:log'] - # - # Validate the commit message: - if message[:5] != 'issue': - sys.stderr.write ("Please begin your commit message with 'issue' characters. message=%s...\n"% \ - message[:15]) - sys.exit(1) - try: - cardIndexNumber = int(message[5:11]) - except: - sys.stderr.write ("Please begin your commit message with 'issue' characters followed" \ - +" by a six-digit index. message=%s...\n"%message[:15]) - sys.exit(1) - fileName = message[:11] - # - # List of card-index - client = pysvn.Client() - myls = client.ls('file://'+repos+'/'+'/issues/') - maxIssue = -1 - for k in range(len(myls)): - maxIssue=max(maxIssue, int(myls[k]['name'].split('/')[-1][5:])) - if int(fileName[5:]) > maxIssue+1: - sys.stderr.write ("The six-digit index (%d) must be <= %d. message=%s...\n"% \ - (int(fileName[5:]), maxIssue+1, message[:15])) - sys.exit(1) - sys.exit(0) - -if __name__ == '__main__': - if len(sys.argv) < 3: - sys.stderr.write("Usage: %s repos txn\n" % (sys.argv[0])) - else: - main(sys.argv[1], sys.argv[2]) -- cgit v1.2.3