From 129dc71d9d580a95fe80657273bb7f00a616c1d7 Mon Sep 17 00:00:00 2001 From: "preed%mozilla.com" Date: Mon, 16 Apr 2007 20:48:28 +0000 Subject: [PATCH] Make sure we flush() the stream after each print(), so the logfile is coherent/readable. irc-r=bsmedberg. git-svn-id: svn://10.0.0.236/trunk@224586 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/tools/cvs2hg-import.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mozilla/tools/cvs2hg-import.py b/mozilla/tools/cvs2hg-import.py index f2d3fe9d972..4eb224157bb 100644 --- a/mozilla/tools/cvs2hg-import.py +++ b/mozilla/tools/cvs2hg-import.py @@ -152,6 +152,7 @@ def ensurevalue(val, envvar, default = None): def rmfileortree(path): print "Removing %s" % path + sys.stdout.flush() if isdir(path): rmtree(path) else: @@ -219,6 +220,7 @@ def ImportMozillaCVS(directory, cvsroot=None, hg=None, tempdir=None, mode=None, source = "%s/mozilla/%s" % (tempd, f) dest = "%s/%s" % (directory, f) print "Moving %s to %s" % (source, dest) + sys.stdout.flush() rename(source, dest) check_call(['hg', 'add'], cwd=directory) @@ -248,6 +250,7 @@ def ImportMozillaCVS(directory, cvsroot=None, hg=None, tempdir=None, mode=None, except Exception, e: print "ImportMozillaCVS: Exception hit: %s" % (str(e)) + sys.stdout.flush() raise finally: @@ -290,12 +293,16 @@ if __name__ == '__main__': if options.initrepo: print "Initializing hg repository '%s'." % args[0] + sys.stdout.flush() InitRepo(args[0], options.hg) ImportMozillaCVS(args[0], options.hg, options.cvsroot, options.tempdir, 'init') print "Initialization successful." + sys.stdout.flush() else: print "Importing CVS to repository '%s'." % args[0] + sys.stdout.flush() ImportMozillaCVS(args[0], options.hg, options.cvsroot, options.tempdir, 'import', options.importdate) print "Import successful." + sys.stdout.flush()