Initial commit of release script.
[jarrpa/prequel.git] / scripts / git_utils.py
index 6294eded87f7a240258d5faf575e486b5a5e2377..32d1b2fb97e52362590edb4ae3874cab2e759c44 100644 (file)
@@ -4,7 +4,7 @@
 #
 # $Copyright (C) 2012 Jose A. Rivera <jarrpa@redhat.com>$
 #
-# $Date: 2012-05-24 16:22:04 -0500 UTC$
+# $Date: 2012-05-31 15:36:03 -0500$
 #
 # ---------------------------------------------------------------------------- #
 #
@@ -41,7 +41,7 @@ import time as _time
 from datetime import datetime, timedelta, tzinfo
 
 
-def git(args):
+def git(args, interactive=False):
   if type(args) == str:
     tmp = args.split('"')
     tmp2 = []
@@ -52,9 +52,19 @@ def git(args):
         tmp2 = tmp2 + tmp[i].split()
     args = tmp2
   args = ['git'] + args
-  git = subprocess.Popen(args, stdout=subprocess.PIPE)
-  details = git.stdout.read()
-  details = details.strip()
+  if not interactive:
+    out = subprocess.PIPE
+    sh  = False
+  else:
+    out = None
+    sh  = True
+  git = subprocess.Popen(args, stdout=out)
+  if not interactive:
+    details = git.stdout.read()
+    details = details.strip()
+  else:
+    git.wait()
+    details = None
   return details
 
 def git_config(key):