Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2008-08-01 09:36:51 (GMT)
committer Simon Schampijer <simon@schampijer.de>2008-08-01 09:36:51 (GMT)
commite1bd64439c2d1e9546db87a417cf6774e4ec6064 (patch)
treeb0e7c33a90bf8896ad8b418c26ad40cf03a73b96 /src
parente6decf93da396f6f9900ff0c2d098aed2a9650bf (diff)
Add git tagging to the 'setup.py release' command
added as well better error handling
Diffstat (limited to 'src')
-rw-r--r--src/sugar/activity/bundlebuilder.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/sugar/activity/bundlebuilder.py b/src/sugar/activity/bundlebuilder.py
index f0cd574..b8f87a7 100644
--- a/src/sugar/activity/bundlebuilder.py
+++ b/src/sugar/activity/bundlebuilder.py
@@ -286,10 +286,12 @@ def cmd_genpot(config, options, args):
def cmd_release(config, options, args):
if not os.path.isdir('.git'):
print 'ERROR - this command works only for git repositories'
+ return
retcode = subprocess.call(['git', 'pull'])
if retcode:
print 'ERROR - cannot pull from git'
+ return
print 'Bumping activity version...'
@@ -348,20 +350,32 @@ def cmd_release(config, options, args):
f.write(news)
f.close()
+ print 'Creating the bundle...'
+ packager = XOPackager(config)
+ packager.package()
+
print 'Committing to git...'
changelog = 'Release version %d.' % version
retcode = subprocess.call(['git', 'commit', '-a', '-m % s' % changelog])
if retcode:
print 'ERROR - cannot commit to git'
+ return
+
+ retcode = subprocess.call(['git', 'tag', 'v%s' % version])
+ if retcode:
+ print 'ERROR - cannot tag the commit'
+ return
retcode = subprocess.call(['git', 'push'])
if retcode:
print 'ERROR - cannot push to git'
-
- print 'Creating the bundle...'
- packager = XOPackager(config)
- packager.package()
+ return
+
+ retcode = subprocess.call(['git', 'push', '--tags'])
+ if retcode:
+ print 'ERROR - cannot push tags to git'
+ return
print 'Done.'