diff options
author | Peter Bex <peter@more-magic.net> | 2012-01-08 16:16:45 +0100 |
---|---|---|
committer | Peter Bex <peter@more-magic.net> | 2012-01-08 16:16:45 +0100 |
commit | 4c23ff89da49125e28e9dd55d515e65a539509c7 (patch) | |
tree | 346597afead54f411359f39b7ec8d534b65db0e9 /egg-author.py | |
parent | ca806ba8ab34180aa977ad7169998c9bb2ffb304 (diff) | |
download | hg-egg-author-4c23ff89da49125e28e9dd55d515e65a539509c7.tar.gz |
Flush meta-file after writing to it. This allows us to properly probe whether it's been changed or not
Diffstat (limited to 'egg-author.py')
-rw-r--r-- | egg-author.py | 11 |
1 files 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, |