J'aurais d commiter plus tt...
N. darcs-hash:20030216142821-a279a-3830c365caa8617fa220094a6c73755fc222fd62.gz
This commit is contained in:
parent
0dff5c61c6
commit
88dd8afc71
1 changed files with 55 additions and 28 deletions
|
@ -8,6 +8,9 @@
|
||||||
#
|
#
|
||||||
# modif par OS 15/05/00 ajout d'un Reply-To...
|
# modif par OS 15/05/00 ajout d'un Reply-To...
|
||||||
#
|
#
|
||||||
|
# Ajouts par NS 13/02/03 : signature qui explique un peu ce qui se passe, et
|
||||||
|
# création automatique d'un lien vers la page webcvs qui présente le diff.
|
||||||
|
#
|
||||||
# Intimement lié à CVSROOT/loginfo
|
# Intimement lié à CVSROOT/loginfo
|
||||||
#
|
#
|
||||||
|
|
||||||
|
@ -36,19 +39,44 @@ for uid in os.listdir('/var/cvs'):
|
||||||
("Subject: CVS Commit par %s\n" % uid)+ \
|
("Subject: CVS Commit par %s\n" % uid)+ \
|
||||||
"Organization: Crans Internet Site\n" + \
|
"Organization: Crans Internet Site\n" + \
|
||||||
"Newsgroups: crans.cvs-checkins\n" + \
|
"Newsgroups: crans.cvs-checkins\n" + \
|
||||||
"Reply-To: Nounous <nounous@crans.org>\n" + \
|
"Reply-To: Nounous <nounou@crans.org>\n" + \
|
||||||
"Followup-To: crans.informatique\n" )
|
"Followup-To: crans.informatique\n" )
|
||||||
|
|
||||||
so.append("MIME-Version: 1.0\n" + \
|
so.append("MIME-Version: 1.0\n" + \
|
||||||
"Content-Type: text/plain\n")
|
"Content-Type: text/plain\n")
|
||||||
so.append("\n")
|
so.append("\n")
|
||||||
envoie = 0
|
envoie = 0
|
||||||
|
links_base="http://www.crans.org/cgi-bin/cvsweb"
|
||||||
while 1:
|
while 1:
|
||||||
s = fi.readline()
|
s = fi.readline()
|
||||||
if not s: break
|
if not s: break
|
||||||
envoie = 1
|
envoie = 1
|
||||||
|
links=['Liens vers les diffs sur cvsweb :\n']
|
||||||
|
diffok = 0
|
||||||
|
|
||||||
|
# On essaye de créer les liens vers cvsweb automatiquement.
|
||||||
|
try:
|
||||||
|
if s[0:3]=="web":
|
||||||
|
link=string.split(s)
|
||||||
|
for file in link[1:]:
|
||||||
|
file=string.split(file,",")
|
||||||
|
if not string.split(file[0],".")[-1] in ['jpg','jpeg','gif','png']:
|
||||||
|
links.append("%s/%s/%s.diff?r1=%s&r2=%s\n" % (links_base,link[0],file[0],file[1],file[2]))
|
||||||
|
diffok = 1
|
||||||
|
# S'il y a au moins un diff affichable, on donne le lien.
|
||||||
|
if diffok:
|
||||||
|
links.append('\n')
|
||||||
|
s=string.join(links,'')
|
||||||
|
else:
|
||||||
s=LFsplit(s)
|
s=LFsplit(s)
|
||||||
so.append(s)
|
so.append(s)
|
||||||
|
except:
|
||||||
|
so.append(s)
|
||||||
|
# Avec une signature c'est plus propre.
|
||||||
|
so.append("\n" + \
|
||||||
|
"-- \n" + \
|
||||||
|
"Notification automatique des CVS commits sur le site du CR@NS.\n"+ \
|
||||||
|
"Voir http://www.crans.org/cgi-bin/cvsweb/web/ pour accéder aux archives CVS complètes.")
|
||||||
|
|
||||||
|
|
||||||
# maintenant, on envoie :
|
# maintenant, on envoie :
|
||||||
|
@ -62,4 +90,3 @@ for uid in os.listdir('/var/cvs'):
|
||||||
except:
|
except:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue