Page MenuHomePhabricator

scap remove-patch: support removing multiple patches
Closed, ResolvedPublic

Description

I just tried to remove the patches for T404392 after they were both merged on master and backported to wmf.18, but scap didn’t like that:

lucaswerkmeister-wmde@deploy1003 /srv/patches $ scap remove-patch --message-body 'Dropping patches already made public (T404392)' /srv/patches/{next,1.45.0-wmf.18}/extensions/WikiLambda/{01,02}-T404392.patch                                                                                                                                                                    
usage: scap [-h] <command> ...                                                                                                                                                                                                                                                                                                                                                                
scap: error: extra arguments found: /srv/patches/next/extensions/WikiLambda/02-T404392.patch /srv/patches/1.45.0-wmf.18/extensions/WikiLambda/01-T404392.patch /srv/patches/1.45.0-wmf.18/extensions/WikiLambda/02-T404392.patch                                                                                                                                                              

So I did it manually instead.

lucaswerkmeister-wmde@deploy1003 /srv/patches $ git rm -r 1.45.0-wmf.18/extensions/WikiLambda/ next/extensions/WikiLambda/
rm '1.45.0-wmf.18/extensions/WikiLambda/01-T404392.patch'
rm '1.45.0-wmf.18/extensions/WikiLambda/02-T404392.patch'
rm 'next/extensions/WikiLambda/01-T404392.patch'
rm 'next/extensions/WikiLambda/02-T404392.patch'
lucaswerkmeister-wmde@deploy1003 /srv/patches $ git commit
[master 071e956] Drop patches already made public
 4 files changed, 788 deletions(-)
 delete mode 100644 1.45.0-wmf.18/extensions/WikiLambda/01-T404392.patch
 delete mode 100644 1.45.0-wmf.18/extensions/WikiLambda/02-T404392.patch
 delete mode 100644 next/extensions/WikiLambda/01-T404392.patch
 delete mode 100644 next/extensions/WikiLambda/02-T404392.patch

Can we change scap remove-patch to accept a list of patches as command-line arguments? AFAICT it should be straightforward, just os.unlink() all of them in turn in RemovePatch._operation_on_patch().

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
scap remove-patch: support removing multiple patchesrepos/releng/scap!1012dancymaster-Ica45162df03b4e4184dc4ad24e809757da1d67camaster
Customize query in GitLab

Event Timeline

Well, I thought it would be straightforward based on looking at the code, but apparently I was looking at an outdated version of the code. The current version doesn’t actually os.unlink() anymore, it does other stuff that I’m not sure I understand.

dancy claimed this task.
dancy subscribed.

Fix deployed in scap 4.227.0.