>>If I'm understanding your situation correctly, I believe you can use rebase
>>to update a whole queue of dependent patches, provided you have the
>>format-source extension enabled.

Ok.  For anyone with mq patch queues, here's a sequence that should
work.  I hit a problem, and will file a bug on clang-format - the
sequence below side-steps the bug.

I found when I reviewed my queues in more detail that I only have maybe
6 active queues (mostly for specific projects) with perhaps 50-100
active patches; a number of other queues for areas I'm not actively
working on at the moment (like my webrtc datachannels queue), and quite
a few WIP queues for work I abandoned or decided to mothball, or for
completed work (like webrtc import patch queues).  Most of those date
back to 2016 or earlier.

At times in the past I've had multi-hundred patches for a few dozen
active queues.  That would have made this issue more problematic,

(Note: this sequence below could probably be automated.  It's not worth
my time to do so, however.)

# First, ensure the tools are set up:

# do these once; no need to do them again
./mach bootstrap
./mach clang-format
# that forces clang-tidy/etc to be downloaded and setup! (bug)

# Now here's how to reformat your patches:

hg pull -u
hg tip
# record rev of tip of tree

Now for each set of patches that can be applied together (assuming
they're at 0-N of the current queue; if not adjust accordingly):

hg qshow 0 | head 10
# Use this to find the parent rev this sequence was applied on.
# In some cases that rev is gone (a patch that has since been pushed),
# If it's not found, use PRE_TREEWIDE_CLANG_FORMAT instead.
hg update -r <rev>

hg qpush
# resolve conflicts if any and hg qref
# repeat hg qpush/resolve for all patches in the sequence (N)

hg qser >/tmp/patch_names
hg qfin -a
# if not already on PRE_TREEWIDE_CLANG_FORMAT:
# resolve any conflicts before we reformat

hg rebase -d <tip from above>
# resolve conflicts

# repeat N times:
hg qimport -r tip -n <name of patch from /tmp/patch_names>
# -n name is optional but recommended
hg qpop

Poof!  that *should* be all.

Thanks to jkew, pehrsons, ehsan for suggestions!

Randell Jesup, Mozilla Corp
remove "news" for personal email
dev-platform mailing list

Reply via email to