Pour les diff avec mdp

--
Fred

darcs-hash:20030802193553-41617-6ed5605a38b4cf012377d441ad755866ee13b8b0.gz
This commit is contained in:
pauget 2003-08-02 21:35:53 +02:00
parent 04f967de8e
commit b61abd5ff5

View file

@ -185,9 +185,6 @@ def calculate_diff(filespec, contextlines):
str(e), '\n***** file: ', file, ' cwd: ', os.getcwd()] str(e), '\n***** file: ', file, ' cwd: ', os.getcwd()]
elif newrev == 'NONE': elif newrev == 'NONE':
lines = ['--- %s DELETED ---\n' % file] lines = ['--- %s DELETED ---\n' % file]
elif string.find(file,"httpd.conf") == 0 or string.find(file,"create_sondage.py") == 0:
# Il y a le mdp mysql pour les sondages dans ces fichiers
lines = ['--- diff de %s masquée ---n' % file]
else: else:
# This /has/ to happen in the background, otherwise we'll run into CVS # This /has/ to happen in the background, otherwise we'll run into CVS
# lock contention. What a crock. # lock contention. What a crock.
@ -203,6 +200,17 @@ def calculate_diff(filespec, contextlines):
# ignore the error code, it always seems to be 1 :( # ignore the error code, it always seems to be 1 :(
## if sts: ## if sts:
## return 'Error code %d occurred during diff\n' % (sts >> 8) ## return 'Error code %d occurred during diff\n' % (sts >> 8)
try:
# On vire du diff les lignes marquées avec *PASS*
a=0
while 1:
a=a+1
if string.find(lines[a],'*PASS*') > -1:
lines[a]= '[ Mot de passe ]\n'
except:
a=0
if len(lines) > DIFF_TRUNCATE_IF_LARGER: if len(lines) > DIFF_TRUNCATE_IF_LARGER:
removedlines = len(lines) - DIFF_HEAD_LINES - DIFF_TAIL_LINES removedlines = len(lines) - DIFF_HEAD_LINES - DIFF_TAIL_LINES
del lines[DIFF_HEAD_LINES:-DIFF_TAIL_LINES] del lines[DIFF_HEAD_LINES:-DIFF_TAIL_LINES]