summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStéphane Cerveau <scerveau@collabora.com>2021-09-29 14:41:31 +0200
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-10-10 19:50:10 +0000
commit01fa95d34a7b55c1cd05fcf73470ad65cca7da57 (patch)
tree0d9b77866ec14123c72ee191e61bb18ee6a049bd /scripts
parent442672cfdde73f3bd6460032081b7805d736d255 (diff)
downloadgstreamer-01fa95d34a7b55c1cd05fcf73470ad65cca7da57.tar.gz
move-mrs-script: add url option
You can give as option: --url https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/960>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/move_mrs_to_monorepo.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/move_mrs_to_monorepo.py b/scripts/move_mrs_to_monorepo.py
index 19d5934828..32b1a69e6b 100755
--- a/scripts/move_mrs_to_monorepo.py
+++ b/scripts/move_mrs_to_monorepo.py
@@ -80,12 +80,12 @@ PARSER.add_argument(
required=False,
)
PARSER.add_argument(
- "--mr",
+ "-mr",
+ "--mr-url",
default=None,
- type=int,
+ type=str,
help=(
- "Id of the MR to work on."
- " One (and only one) module must be specified with `--module`."
+ "URL of the MR to work on."
),
required=False,
)
@@ -182,6 +182,7 @@ class GstMRMover:
self.config_files = []
self.gl = None
self.mr = None
+ self.mr_url = None
self.all_projects = []
self.skipped_branches = []
self.git_rename_limit = None
@@ -312,7 +313,12 @@ class GstMRMover:
raise e
def cleanup_args(self):
- if not self.modules:
+ if self.mr_url:
+ self.modules.append(GST_PROJECTS[0])
+ (namespace, module, _, _, mr) = os.path.normpath(urlparse(self.mr_url).path).split('/')[1:]
+ self.modules.append(module)
+ self.mr = int(mr)
+ elif not self.modules:
if self.mr:
sys.exit(f"{red(f'Merge request #{self.mr} specified without module')}\n\n"
f"{bold(' -> Use `--module` to specify which module the MR is from.')}")
@@ -527,6 +533,9 @@ class GstMRMover:
bold(f"{red('SKIPPED')} (couldn't checkout)\n"), nested=False)
return False
+ # unset upstream to avoid to push to main (ie push.default = tracking)
+ self.git("branch", branch, "--unset-upstream")
+
for commit in reversed([c for c in mr.commits()]):
if self.git("cherry-pick", commit.id,
interaction_message=f"cherry-picking {commit.id} onto {branch} with:\n "