[Pkg-mozext-commits] [adblock-plus] 09/17: Issue 2311 - Track remote Git branches
David Prévot
taffit at moszumanska.debian.org
Mon Jun 8 20:50:30 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository adblock-plus.
commit 0f8069e3bde3bfda11cebf8bf96a86b9959519d9
Author: Dave Barker <kzar at kzar.co.uk>
Date: Thu May 7 13:14:18 2015 +0200
Issue 2311 - Track remote Git branches
---
ensure_dependencies.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/ensure_dependencies.py b/ensure_dependencies.py
index 9f2bcc7..def9a7e 100755
--- a/ensure_dependencies.py
+++ b/ensure_dependencies.py
@@ -97,7 +97,20 @@ class Git():
return subprocess.check_output(command, cwd=repo).strip()
def pull(self, repo):
+ # Fetch tracked branches, new tags and the list of available remote branches
subprocess.check_call(["git", "fetch", "--quiet", "--all", "--tags"], cwd=repo)
+ # Next we need to ensure all remote branches are tracked
+ newly_tracked = False
+ remotes = subprocess.check_output(["git", "branch", "--remotes"], cwd=repo)
+ for match in re.finditer(r"^\s*(origin/(\S+))$", remotes, re.M):
+ remote, local = match.groups()
+ with open(os.devnull, "wb") as devnull:
+ if subprocess.call(["git", "branch", "--track", local, remote],
+ cwd=repo, stdout=devnull, stderr=devnull) == 0:
+ newly_tracked = True
+ # Finally fetch any newly tracked remote branches
+ if newly_tracked:
+ subprocess.check_call(["git", "fetch", "--quiet", "origin"], cwd=repo)
def update(self, repo, rev):
subprocess.check_call(["git", "checkout", "--quiet", rev], cwd=repo)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git
More information about the Pkg-mozext-commits
mailing list