From 4c23ff89da49125e28e9dd55d515e65a539509c7 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sun, 8 Jan 2012 16:16:45 +0100 Subject: Flush meta-file after writing to it. This allows us to properly probe whether it's been changed or not --- egg-author.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/egg-author.py b/egg-author.py index b01420d..e8d58c1 100644 --- a/egg-author.py +++ b/egg-author.py @@ -178,13 +178,14 @@ def update_meta(ui, repo): # reopen and write out the new string mf = repo.wfile(meta_file, 'w') mf.write(s) + mf.flush() mf.close - # This doesn't work because repo.status operates on a cache or something - #if len(repo.status(match=matchmod.exact('.', '.', [meta_file]))[0]) == 0: - # ui.status(_('Meta-file %s was already up-to-date\n') % meta_file) - #else: - ui.status(_('Meta-file %s is updated\n') % meta_file) + # Let the user know the file has been updated (or not, if unchanged) + if len(repo.status(match=matchmod.exact('.', '.', [meta_file]))[0]) == 0: + ui.status(_('Meta-file %s was already up-to-date\n') % meta_file) + else: + ui.status(_('Meta-file %s is updated\n') % meta_file) cmdtable = { "eggtag": (eggtag, -- cgit v1.2.3