]> projects.mako.cc - iron-blogger/commitdiff
fix extraneous commits when people are punted
authorBenjamin Mako Hill <mako@atdot.cc>
Wed, 25 Jan 2012 22:38:48 +0000 (17:38 -0500)
committerBenjamin Mako Hill <mako@atdot.cc>
Wed, 25 Jan 2012 22:38:48 +0000 (17:38 -0500)
Fixes a small bug where the dry_run option still results in commits of
to git of the ledger and bloggers.yml when people are punted. I ended up
double-charging folks because of this but this should definitely address
the issue.

weekly-update.py

index 06d85182d84c5cbf127967e0f76837fa970baf62..284ffb6056a9bf3fee868a3005bafc7bdd917d27 100755 (executable)
@@ -81,9 +81,13 @@ if punt:
     with open('bloggers.yml','w') as b:
         yaml.safe_dump(bloggers, b)
 
     with open('bloggers.yml','w') as b:
         yaml.safe_dump(bloggers, b)
 
-    subprocess.check_call(["git", "commit", "ledger", "bloggers.yml",
-                           "-m", "Punts for %s" % (today,)])
+    if not dry_run:
+        subprocess.check_call(["git", "commit", "ledger", "bloggers.yml",
+                               "-m", "Punts for %s" % (today,)])
 
 # if it's a dry run, lets set the ledger back to the beginning state
 if dry_run:
     subprocess.check_call(["git", "checkout", "ledger"])
 
 # if it's a dry run, lets set the ledger back to the beginning state
 if dry_run:
     subprocess.check_call(["git", "checkout", "ledger"])
+    
+    if punt:
+        subprocess.check_call(["git", "checkout", "bloggers.yml"])

Benjamin Mako Hill || Want to submit a patch?