Prune remote branches when mirroring.

* jeepyb/cmd/run_mirror.py: Use git fetch -p origin so deleted
remote branches will be removed locally before processing. Also deal
with pip freeze warnings which might include "==" by skipping lines
containing spaces when looking for package versions to download, and
make sure to match "-e" lines as well.

Change-Id: I646ce937b59da211d03ae2d3b09c9aabd10cb91e
Reviewed-on: https://review.openstack.org/23494
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
This commit is contained in:
Jeremy Stanley 2013-03-05 00:58:13 +00:00 committed by Jenkins
parent 933e551cbf
commit d85ad3e3bc

View File

@ -101,7 +101,7 @@ def main():
if DEBUG:
print(out)
os.chdir(short_project)
out = run_command("git fetch origin")
out = run_command("git fetch -p origin")
if DEBUG:
print(out)
@ -140,7 +140,8 @@ def main():
freeze = run_command("%s freeze -l" % pip)
reqfd = open(reqs, "w")
for line in freeze.split("\n"):
if "==" in line:
if line.startswith("-e ") or (
"==" in line and " " not in line):
reqfd.write(line + "\n")
reqfd.close()
out = run_command(venv_format % (PIP_DOWNLOAD_CACHE, venv))