From b7af5fc56816864522b452641cd1601c7fdc696b Mon Sep 17 00:00:00 2001 From: cmpilato Date: Tue, 23 Jan 2007 19:51:05 +0000 Subject: [PATCH] * bin/loginfo-handler Add some more debugging, and consume stdin so CVS's pipe doesn't back up (which causes an abort()). git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1518 8cb11bc2-c004-0410-86c3-e597b4017df7 --- bin/loginfo-handler | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/loginfo-handler b/bin/loginfo-handler index bf0f4ae3..218da9e9 100755 --- a/bin/loginfo-handler +++ b/bin/loginfo-handler @@ -49,9 +49,13 @@ import vclib.bincvs DEBUG_FLAG = 0 ## output functions -def debug(text): +def debug(text): if DEBUG_FLAG: - print 'DEBUG(viewvc-loginfo):', text + if type(text) != (type([])): + text = [text] + for line in text: + line = line.rstrip('\n\r') + print 'DEBUG(viewvc-loginfo):', line def warning(text): print 'WARNING(viewvc-loginfo):', text @@ -256,7 +260,8 @@ if __name__ == '__main__': ## parse arguments argc = len(sys.argv) - debug('Got %d arguments: %s' % (argc, str(sys.argv))) + debug('Got %d arguments:' % (argc)) + debug(map(lambda x: ' ' + x, sys.argv)) # if we have more than 3 arguments, we are likely using the # newer loginfo format introduced in CVS 1.12: @@ -292,6 +297,9 @@ if __name__ == '__main__': fun = HeuristicArgParse directory, files = fun(arg, repository) + + debug('Discarded from stdin:') + debug(map(lambda x: ' ' + x, sys.stdin.readlines())) # consume stdin repository = cvsdb.CleanRepository(repository)