From 719965af35a2fab96cb578c8a19a48a2cf9fe8e8 Mon Sep 17 00:00:00 2001 From: Nico Sallembien Date: Tue, 20 Apr 2010 15:28:19 -0700 Subject: [PATCH] Override manifest file only after it is fully written to disk. We called "Override()" before closing the file passed in argument. Change-Id: I15adb99deb14297ef72fcb1b0945eb246f172fb0 --- subcmds/sync.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subcmds/sync.py b/subcmds/sync.py index 67213d3a..613cc81c 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -226,13 +226,13 @@ uncommitted changes are present' % project.relpath f = open(manifest_path, 'w') try: f.write(manifest_str) - self.manifest.Override(manifest_name) finally: f.close() except IOError: print >>sys.stderr, 'error: cannot write manifest to %s' % \ manifest_path sys.exit(1) + self.manifest.Override(manifest_name) else: print >>sys.stderr, 'error: %s' % manifest_str sys.exit(1)