metacity r4043 - in trunk: . tools



Author: tthurman
Date: Wed Nov 26 05:28:02 2008
New Revision: 4043
URL: http://svn.gnome.org/viewvc/metacity?rev=4043&view=rev

Log:
	* tools/announce-wrangler.py: renamed ini file
	* tools/commit-wrangler.py: rewriting in terms of moap



Modified:
   trunk/ChangeLog
   trunk/tools/announce-wrangler.py
   trunk/tools/commit-wrangler.py

Modified: trunk/tools/announce-wrangler.py
==============================================================================
--- trunk/tools/announce-wrangler.py	(original)
+++ trunk/tools/announce-wrangler.py	Wed Nov 26 05:28:02 2008
@@ -137,7 +137,7 @@
                 text_list(text_links, 'html'))
 
 cp = ConfigParser.ConfigParser()
-cp.read(os.environ['HOME']+'/.config/release-wrangler.ini')
+cp.read(os.environ['HOME']+'/.config/metacity/tools.ini')
 
 wp = wordpresslib.WordPressClient(
     cp.get('release-wrangler', 'blogurl'),

Modified: trunk/tools/commit-wrangler.py
==============================================================================
--- trunk/tools/commit-wrangler.py	(original)
+++ trunk/tools/commit-wrangler.py	Wed Nov 26 05:28:02 2008
@@ -26,6 +26,7 @@
 import sys
 import os
 import posixpath
+import ConfigParser
 
 # FIXME: Needs tidying into separate functions.
 
@@ -83,85 +84,30 @@
 
 #####################
 
-get_up_to_date()
+change_filename = 'ChangeLog'
 
-discoveries = {}
+get_up_to_date()
 
-current_file = '?'
+cp = ConfigParser.ConfigParser()
+cp.read(os.environ['HOME']+'/.config/metacity/tools.ini')
 
-diff = commands.getstatusoutput('svn diff --diff-cmd $(which diff) -x -up')[1]
+os.environ['CHANGE_LOG_NAME'] = cp.get('commit-wrangler', 'name')
+os.environ['CHANGE_LOG_EMAIL_ADDRESS'] = cp.get('commit-wrangler', 'address')
 
-for line in diff.split('\n'):
-    if line.startswith('---'):
-        current_file = line[4:line.find('\t')]
-    elif line.startswith('@@'):
-        atatpos = line.find('@@', 3)+3
-        discoveries.setdefault(current_file,{})[line[atatpos:line.find(' ',atatpos)]] = 1
-
-# yes, I know this is MY username. I will come back and fix it
-# later, but for now there is a lot else to do. FIXME
-your_username = 'Thomas Thurman  <tthurman gnome org>'
-
-change_filename = posixpath.expanduser("~/.commit-wrangler.txt")
-change = open(change_filename, 'w')
-change.write('# You are checking in a single changeset.\n')
-change.write('# The message below is the one which will be used\n')
-change.write('# both in the checkin and the changelog.\n')
-change.write('# Any lines starting with a "#" don\'t go in.\n')
-change.write('#\n')
-
-change.write('%s  %s\n\n' % (
-    time.strftime('%Y-%m-%d',time.gmtime()),
-    your_username))
-
-for filename in discoveries:
-    change.write(wordwrap('* %s (%s): something' % (
-                filename, ', '.join(discoveries[filename])),
-                '        ')+'\n')
-
-change.write('\n#\n#\n##############\n#\n#\n#\n')
-change.write('# And this is the original diff:\n#\n#')
-change.write(diff.replace('\n','\n#'))
-change.write('\n#\n#\n##############\n# EOF\n')
-change.close()
+print commands.getoutput('moap cl prep')
 
 time_before = os.stat(change_filename)[8]
 os.system(favourite_editor()+' +6 %s ' % (change_filename))
 
 if os.stat(change_filename)[8] == time_before:
-    print 'No change; aborting.'
+    print 'No change; aborting:'
+    print commands.getoutput('svn revert '+change_filename)
     sys.exit(0)
 
 # Update the changelog
 
-changelog_new = open('ChangeLog.tmp', 'w')
-changelog_justfunc = open(change_filename+'.justfunc', 'w')
-change = open(change_filename, 'r')
-for line in change.readlines():
-    if not line.startswith('#'):
-        changelog_new.write(line)
-        changelog_justfunc.write(line)
-change.close()
-changelog_justfunc.close()
-
-changelog = open('ChangeLog', 'r')
-for line in changelog.readlines():
-    changelog_new.write(line)
-
-changelog.close()
-changelog_new.close()
-
-os.rename('ChangeLog.tmp', 'ChangeLog')
-
-committing = commands.getstatusoutput('svn commit --file %s.justfunc' % (change_filename))[1]
-
-print 'Committed: ', committing
-
-checkin = committing[committing.find('Committed revision')+19:]
-checkin = checkin[:checkin.find('.')]
-# this number will be useful in the future for updating
-# Bugzilla.
+print commands.getoutput("moap cl ci")
 
-print
-print 'http://svn.gnome.org/viewvc/metacity?rev=%s&view=rev' % (checkin)
+#print
+#print 'http://svn.gnome.org/viewvc/metacity?rev=%s&view=rev' % (checkin)
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]