Commit 70c9d8c3 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

convert-pull-local: nicer user feedback and help

parent 41a271fd4db1
#!/usr/bin/env python3
import argparse
import sys
import time
from subprocess import Popen, PIPE, check_call, check_output
......@@ -13,7 +14,12 @@
for segment in brname[:-len(STABLE_BRANCH_SUFFIX)].split('-'))
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
epilog=""
"Examples: `{self} gitlab-ce heptapod-rails` (the default)\n"
" `{self} --branch-prefix 13-9-stable`".format(self=sys.argv[0])
)
parser.add_argument("--heptapod-repo", default='heptapod-rails')
parser.add_argument("--gitlab-repo", default='gitlab-ce')
parser.add_argument("--branch-prefix")
......@@ -41,9 +47,9 @@
print("Sorted stable branches: %r" % [b[1] for b in stable_branches])
for version, branch in stable_branches:
print("Pulling Git branch %r -- checking conversion" % branch)
print("Pulling Git branch %r -- checking prior conversion" % branch)
log = Popen(('hg', 'log', '-R', heptapod_repo,
'-r', "bookmark(%s)" % branch),
stderr=PIPE)
log.communicate()
if log.poll() == 0:
......@@ -45,9 +51,9 @@
log = Popen(('hg', 'log', '-R', heptapod_repo,
'-r', "bookmark(%s)" % branch),
stderr=PIPE)
log.communicate()
if log.poll() == 0:
print(" already converted, pull will just be an update")
print(" already converted, pull should be small")
else:
print(" full branch conversion, sleeping first for 10s for "
"easy interruption")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment