summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas James Alexander Thurman <tthurman@src.gnome.org>2008-11-26 05:28:02 +0000
committerThomas James Alexander Thurman <tthurman@src.gnome.org>2008-11-26 05:28:02 +0000
commit6ddec0d855ef7ad71d5972d74c9cad6868af8c36 (patch)
tree78767de9e8422e2b483fe8996a6be0e4bd3f0e7e
parentc0d90e5b761986c1710c3fc3cbdab3028a285d71 (diff)
downloadmetacity-6ddec0d855ef7ad71d5972d74c9cad6868af8c36.tar.gz
renamed ini file rewriting in terms of moap
* tools/announce-wrangler.py: renamed ini file * tools/commit-wrangler.py: rewriting in terms of moap svn path=/trunk/; revision=4043
-rw-r--r--ChangeLog5
-rw-r--r--tools/announce-wrangler.py2
-rw-r--r--tools/commit-wrangler.py80
3 files changed, 19 insertions, 68 deletions
diff --git a/ChangeLog b/ChangeLog
index 52e8491f..09e7e706 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-26 Thomas Thurman <tthurman@gnome.org>
+
+ * tools/announce-wrangler.py: renamed ini file
+ * tools/commit-wrangler.py: rewriting in terms of moap
+
2008-11-25 Thomas Thurman <tthurman@gnome.org>
* configure.in: Post-release bump to 2.25.21.
diff --git a/tools/announce-wrangler.py b/tools/announce-wrangler.py
index 54b45676..71262622 100644
--- a/tools/announce-wrangler.py
+++ b/tools/announce-wrangler.py
@@ -137,7 +137,7 @@ html_version = """\
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'),
diff --git a/tools/commit-wrangler.py b/tools/commit-wrangler.py
index a086a5e6..e61b85ed 100644
--- a/tools/commit-wrangler.py
+++ b/tools/commit-wrangler.py
@@ -26,6 +26,7 @@ import commands
import sys
import os
import posixpath
+import ConfigParser
# FIXME: Needs tidying into separate functions.
@@ -83,85 +84,30 @@ def wordwrap(str, prefix=''):
#####################
-get_up_to_date()
-
-discoveries = {}
-
-current_file = '?'
-
-diff = commands.getstatusoutput('svn diff --diff-cmd $(which diff) -x -up')[1]
+change_filename = 'ChangeLog'
-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')
+get_up_to_date()
-change.write('%s %s\n\n' % (
- time.strftime('%Y-%m-%d',time.gmtime()),
- your_username))
+cp = ConfigParser.ConfigParser()
+cp.read(os.environ['HOME']+'/.config/metacity/tools.ini')
-for filename in discoveries:
- change.write(wordwrap('* %s (%s): something' % (
- filename, ', '.join(discoveries[filename])),
- ' ')+'\n')
+os.environ['CHANGE_LOG_NAME'] = cp.get('commit-wrangler', 'name')
+os.environ['CHANGE_LOG_EMAIL_ADDRESS'] = cp.get('commit-wrangler', 'address')
-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)