Read about our upcoming Code of Conduct on this issue

Commit 22029ff2 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

convert-pull-local: new --push option.

Together with `--min-gitlab-version`, it should reduce
human intervention a lot.
parent 09748e9c6c06
Pipeline #20078 passed with stage
in 41 seconds
......@@ -9,7 +9,7 @@
import sys
import time
from subprocess import Popen, PIPE, check_call, check_output
from subprocess import Popen, PIPE, call, check_call, check_output
from .version import (
level2_version,
......@@ -68,6 +68,11 @@
)
parser.add_argument("--heptapod-repo", default='heptapod-rails')
parser.add_argument("--gitlab-repo", default='gitlab-ce')
parser.add_argument("--push", action="store_true",
help="Perform Mercurial push for each converted "
"bookmark. Assumes that the `default` path of "
"the Mercurial repo is properly configured "
"for push to work without user interaction.")
filt_group = parser.add_mutually_exclusive_group()
filt_group.add_argument("--branch-prefix",
help="Prefix of upstream Git branches to "
......@@ -105,3 +110,9 @@
time.sleep(10)
check_call(('hg', 'pull', '-R', heptapod_repo,
'-r', branch, gitlab_repo))
if cl_args.push:
print("Pushing resulting bookmark %r, as requested" % branch)
retcode = call(('hg', 'push', '-R', heptapod_repo, '-fB', branch))
if retcode not in (0, 1):
return 1
......@@ -51,9 +51,8 @@
cd
convert-pull-local --gitlab-repo omnibus-gitlab \
--heptapod-repo omnibus-heptapod \
--branch-prefix {git_branch}
cd omnibus-heptapod
hg push -fB {git_branch} [URL]
--branch-prefix {git_branch} \
--push
../convert-git-tags-push
```
......
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