--- /dev/null
+#!/usr/bin/python
+
+import os, sys
+
+class GitManage(object):
+
+ def __init__(self):
+ self.exclude = ['']
+ self.dir = os.path.dirname(os.path.abspath(__file__))
+ self.apps = os.listdir(self.dir)
+
+ def process(self, args):
+ for app in self.apps:
+ if not app in self.exclude and os.path.isdir(self.dir + os.sep + app):
+ print app
+ os.chdir(self.dir + os.sep + app)
+ os.system('git ' + args)
+ os.chdir(self.dir)
+
+ def pull(self, repo, branch):
+ args = 'pull ' + repo + ' ' + branch
+ self.process(args)
+
+ def checkout(self, branch):
+ args = 'checkout ' + ' ' + branch
+ self.process(args)
+
+ def diff(self):
+ args = 'diff'
+ self.process(args)
+
+ def list_repos(self):
+ args = 'remote -v'
+ self.process(args)
+
+ def add_repo(self, name, repo):
+ for app in self.apps:
+ if not app in self.exclude and os.path.isdir(self.dir + os.sep + app):
+ print app
+ os.chdir(self.dir + os.sep + app)
+ args = 'remote add ' + name + ' ' + repo + app + '.git'
+ print args
+ os.system('git ' + args)
+
+ def delete_repo(self, repo):
+ for app in self.apps:
+ if not app in self.exclude and os.path.isdir(self.dir + os.sep + app):
+ print app
+ os.chdir(self.dir + os.sep + app)
+ args = 'remote rm ' + repo
+ print args
+ os.system('git ' + args)
+
+ def checkout(self, branch):
+ args = 'checkout ' + ' ' + branch
+ self.process(args)
+