changeset 640:3059ee249888

STUB: python/git_merge_master.py
author Jeff Hammel <k0scist@gmail.com>
date Tue, 04 Mar 2014 16:19:37 -0800
parents 3be3b16aeda0
children 15c20cfc6b22
files python/git_merge_master.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/python/git_merge_master.py	Tue Mar 04 11:19:19 2014 -0800
+++ b/python/git_merge_master.py	Tue Mar 04 16:19:37 2014 -0800
@@ -31,6 +31,17 @@
         merge_base = subprocess.check_output(['git', 'merge-base', 'HEAD', 'master']).strip()
         return subprocess.check_output(['git', 'diff', merge_base])
 
+    def checkout(self, branch):
+        subprocess.check_output(['git', 'checkout', branch])
+
+    def pull(self, branch='master'):
+        current_branch = self.branch()
+        if current_branch != branch:
+            self.checkout(branch)
+        subprocess.check_output(['git', 'pull', 'origin', branch])
+        if current_branch != branch:
+            self.checkout(current_branch)
+
     def merge(self):
         pass