Closed Bug 1574377 Opened 6 years ago Closed 4 years ago

moz-phab always installing the full stack of patches, even when you don't want to.

Categories

(Conduit :: moz-phab, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1658817

People

(Reporter: jya, Unassigned)

Details

(Keywords: conduit-triaged)

Example:
$ moz-phab patch D42258
Revision D42258 has child commits. Would you like to patch the full stack?. (YES/No/Always)? n
Patching revisions: D40959 D40960 D40961 D41133 D40962 D40963 D40964 D40965 D40966 D40967 D40968 D40969 D40970 D40971 D40972 D40973 D40974 D37490 D40975 D42232 D42258
Checked out e0e7d2383d6e
Created branch D42258
[D42258 ded894d7babad] Bug 1556489 - P1. Introduce ReplacementChannelConfig.
Date: Fri Aug 16 15:09:27 2019 +1000
3 files changed, 330 insertions(+), 163 deletions(-)
D40959 applied
[D42258 523ab691f92be] Bug 1556489 - P2. Use ReplacementChannelConfig across HttpChannelParent and ContentChild.
Date: Fri Aug 16 15:09:36 2019 +1000
4 files changed, 15 insertions(+), 13 deletions(-)
D40960 applied

So it asks me if I wanted to patch the full stack, I said no, and it applied them all anyway.

patch is checking for parents and children of the patched revision.
By default, it patches parents to avoid the situation where a patch can't be applied.
It also checks if there are any children of the revision and offers to widen the choice and patch the entire stack.
If you'd like to patch just the one revision without its dependencies please add --skip=dependencies.
You can check more options of the patch command by running moz-phab patch -h.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME

This is not the behaviour I have seen.

In my current tree I had patch P1 to P20 already applied, I wanted to add the remaining P21 to P23 (which was being worked on someone else).

Moz-phab removed all my existing, already applied patches, and started to re-apply all of them right from the start (and failed after P13 for some reason).

Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---

moz-phab is applying the entire stack, counting from the first one to the one mentioned in the command and offers to add children.
This is not a bug, it is implemented like that.

I think extending this feature to provide an ability to patch a part of the stack is a good idea.
(I'm naming the revisions D1 to D23, so it will look like Phabricator's revisions)
I'd see this command as moz-phab patch D21 D23 --apply-to here.
It is also possibly to modify the current solution so it would detect the D20.

Currently you could patch D21, then D22 and then D23 in 3 calls:

git checkout D20
moz-phab patch D21 --skip-dependencies --apply-to here --no-branch
moz-phab patch D22 --skip-dependencies --apply-to here --no-branch
moz-phab patch D23 --skip-dependencies --apply-to here

Which would create a branch D23 containing all 3 commits branched of the D20.

Type: defect → enhancement
Priority: -- → P3
Status: REOPENED → RESOLVED
Closed: 6 years ago4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.