Generated libbe/_version.py was not UTF-8 aware.
[be.git] / release.py
index 6481152c5cade557e37ebc077775a73454dc2538..9e80599d6ea14b776e6a2a6e53446f493622f53b 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/python
 #
-# Copyright (C) 2009-2010 W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2009-2011 Chris Ball <cjb@laptop.org>
+#                         W. Trevor King <wking@drexel.edu>
 #
 # This file is part of Bugs Everywhere.
 #
@@ -119,6 +120,11 @@ def set_vcs_name(be_dir, vcs_name='None'):
             invoke(['sed', '-i', "s/^vcs_name:.*/vcs_name: %s/" % vcs_name,
                     filename])
 
+def make_id_cache():
+    """Generate .be/id-cache so users won't need to.
+    """
+    invoke(['./be', 'list'])
+
 def create_tarball(tag):
     release_name='be-%s' % tag
     export_dir = release_name
@@ -130,7 +136,12 @@ def create_tarball(tag):
     shutil.copy(os.path.join('libbe', '_version.py'),
                 os.path.join(export_dir, 'libbe', '_version.py'))
     make_changelog(os.path.join(export_dir, 'ChangeLog'), tag)
+    make_id_cache()
+    print 'copy .be/id-cache to %s/.be/id-cache' % export_dir
+    shutil.copy(os.path.join('.be', 'id-cache'),
+                os.path.join(export_dir, '.be', 'id-cache'))
     set_vcs_name(os.path.join(export_dir, '.be'))
+    os.remove(os.path.join(export_dir, 'update_copyright.py'))
     tarball_file = '%s.tar.gz' % release_name
     print 'create tarball', tarball_file
     invoke(['tar', '-czf', tarball_file, export_dir])
@@ -149,9 +160,9 @@ Create a git tag and a release tarball from the current revision.
 For example
   %prog 1.0.0
 
-You may wish to test this out in a dummy branch first to make sure it
-works as expected to avoid the tedium of unwinding the version-bump
-commit if it fails.
+If you don't like what got committed, you can undo the release with
+  $ git tag -d 1.0.0
+  $ git reset --hard HEAD^
 """
     p = optparse.OptionParser(usage)
     p.add_option('--test', dest='test', default=False,