Open Bug 1585192 Opened 6 years ago Updated 2 years ago

moz-phab: abort: hidden revision '...' was rewritten as: ...!

Categories

(Conduit :: moz-phab, defect, P2)

defect

Tracking

(Not tracked)

REOPENED

People

(Reporter: nalexander, Unassigned)

References

Details

(Keywords: conduit-triaged)

Attachments

(1 file)

Here's the log:

$ moz-phab submit 6bdb5ac8 4386b834
... (very long backscroll, these commits were very large)
Creating new revision:
573371:4386b834d4c3 Bug 1580356 - TO FOLD - Fix l10n. r?#build
Linting...
No lint engine configured for this project.
Running unit tests...
No unit test engine is configured for this project.
 SKIP STAGING  Phabricator does not support staging areas for this repository.
Created a new Differential revision:
        Revision URI: https://phabricator.services.mozilla.com/D47702

Included changes:
  M       mobile/android/locales/Makefile.in
rebasing 573352:5848ef0d44b2 "Bug 1580356 - Part 1: Remove Fennec from the build. r?snorp!,#build!"
rebasing 573373:9aa63dd1f897 "Bug 1580356 - TO FOLD - Remove Fennec Java sources. r?snorp"
note: not rebasing 573361:215e33554bc0 "Bug 1580356 - TO FOLD - Remove Fennec Java sources. r?snorp" and its descendants as this would cause divergence
note: not rebasing 573367:4caefae1817d "Bug 1580356 - TO FOLD - Tear out some configure bits. r?#build" and its descendants as this would cause divergence
note: not rebasing 573368:e2240d97a181 "Bug 1580356 - TO FOLD - Tear out docs, some tests, thirdparty references. r?#build" and its descendants as this would cause divergence
note: not rebasing 573369:a797d56f064a "Bug 1580356 - TO FOLD - Tear out API keys. r?#build" and its descendants as this would cause divergence
note: not rebasing 573370:817e5aef98fe "Bug 1580356 - TO FOLD - Fix lints. r?#build" and its descendants as this would cause divergence
abort: hidden revision '9aa63dd1f89702215a1d2e220840bae2d6b11fd3' was rewritten as: e8b9b1740c9f!
(use --hidden to access hidden revisions)
CommandError: command 'hg' failed to complete successfully

Here's what the top of my repository was left as:

Commits:
e8b9b174 o tip draft Bug 1580356 - TO FOLD - Remove Fennec Java sources. r?snorp                                                                                                                                                                                        Nick 2019-09-24
         |
81879a64 o draft Bug 1580356 - Part 1: Remove Fennec from the build. r?snorp!,#build!                                                                                                                                                                                   Nick 2019-09-24
         |
644f540a | @ draft orphan Bug 1580356 - TO FOLD - Fix l10n. r?#build                                                                                                                                                                                                    Nick 2019-09-30
         | |
28de3227 | | * draft orphan Bug 1580356 - TO FOLD - Fix lints. r?#build                                                                                                                                                                                                 Nick 2019-09-25
         | | |
c12280f2 | | | * draft orphan Bug 1580356 - TO FOLD - Tear out API keys. r?#build                                                                                                                                                                                       Nick 2019-09-24
         | | | |
52962f17 | | | | * draft orphan Bug 1580356 - TO FOLD - Tear out docs, some tests, thirdparty references. r?#build                                                                                                                                                      Nick 2019-09-24
         | | | | |
a030e2ed | | | | | * draft orphan Bug 1580356 - TO FOLD - Tear out some configure bits. r?#build                                                                                                                                                                        Nick 2019-09-24
         | | | | | |
8547f260 o | | | | | draft Bug 1580356 - Pre: Don't collect package metrics. r?#build                                                                                                                                                                                   Nick 2019-09-19
         | | | | | |
817e5aef | x | | | | draft obsolete Bug 1580356 - TO FOLD - Fix lints. r?#build                                                                                                                                                                                         Nick 2019-09-25
         | |/ / / /
a797d56f | x / / / draft obsolete Bug 1580356 - TO FOLD - Tear out API keys. r?#build                                                                                                                                                                                   Nick 2019-09-24
         | |/ / /
e2240d97 | x / / draft obsolete Bug 1580356 - TO FOLD - Tear out docs, some tests, thirdparty references. r?#build                                                                                                                                                      Nick 2019-09-24
         | |/ /
4caefae1 | x / draft obsolete Bug 1580356 - TO FOLD - Tear out some configure bits. r?#build                                                                                                                                                                            Nick 2019-09-24
         | |/
215e3355 | x draft obsolete Bug 1580356 - TO FOLD - Remove Fennec Java sources. r?snorp                                                                                                                                                                                 Nick 2019-09-24
         | |
5848ef0d | x draft obsolete Bug 1580356 - Part 1: Remove Fennec from the build. r?snorp!,#build!                                                                                                                                                                        Nick 2019-09-24
         | |
29a4aea8 | x draft obsolete Bug 1580356 - Pre: Don't collect package metrics. r?#build                                                                                                                                                                                  Nick 2019-09-19
         |/
6bdb5ac8 o draft Bug 1580356 - Pre: Allow no download information in informulate.py. r?#build                                                                                                                                                                           Nick 2019-09-11

I see this a great deal with complicated patch stacks, and let me tell you, it's really fun to manually excavate the mountain of rebases left behind.

Keywords: conduit-triaged
Priority: P1 → --
See Also: → 1525136

The same issue hit me several times now as well.

This seems like Mercurial wanted to rebase a hidden revision.
@sg provided a log. I can't say it's the same issue, as it didn't printed out the error message abort: hidden revision '{}' was rewritten as: {}! nor the note: not rebasing {rev}:{node} "{message}" and its descendants as this would cause divergence
I also can't find the reason for this to happen occasionally.
It was raised in Mercurial.finalize function.

2019-10-16 15:17:24,459 DEBUG    $ hg --config extensions.rebase= log -T '{rev} {node}\n' --hidden -r 'successors(38dad706cd4ff74b493bf684383c73fd2e37d0f2) and not obsolete()'
2019-10-16 15:17:24,757 DEBUG    557686 2db76b8b8dfe181d27723eaaab3f72e895f3c407
2019-10-16 15:17:24,758 DEBUG    $ hg --config extensions.rebase= log -T '{node}' -r 'parents(e433a6ebf7e49615fd8b50ac52c5431b1e5bfc8b)'
2019-10-16 15:17:24,946 DEBUG    
2019-10-16 15:17:24,946 ERROR    CommandError: command 'hg' failed to complete successfully

(In reply to Piotr Zalewa [:zalun] from comment #2)

This seems like Mercurial wanted to rebase a hidden revision.
@sg provided a log. I can't say it's the same issue, as it didn't printed out the error message abort: hidden revision '{}' was rewritten as: {}! nor the note: not rebasing {rev}:{node} "{message}" and its descendants as this would cause divergence

The abort message was there, but only on the console, not in the log.

I am not completely sure if I saw the note message.

The logging is updated.
Please attach the logs if this issue will happen again

Closing due to lack of logs/activity. Don't hesitate to reopen if the issue reoccurs.

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

Got this today. Log posted in comment 6.

Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Assignee: nobody → pzalewa
Keywords: conduit-triaged
Priority: -- → P3

I hit this bug very frequently. Here's the log (no --trace) from just now: https://gist.github.com/mstange/aae5590d6baf80c660c054f82c0d36d7

Roughly, what I did was: Commit A, B, C, D, and then moz-phab submit the range [A, B, C, D]. Then commit E, F, and G, and move E before A using hg histedit, so that the commit order is now E, A, B, C, D, F, G. G is the current working directory. Then moz-phab submit the range [E, A, B, C, D].

Confirmed. MozPhab shouldn't fail like that.

Steps to replicate in Suite (every commit changes different file to avoid conflicts):

echo a > A; hg add A; hg commit -m A
echo b > B; hg add B; hg commit -m B
moz-phab -b 1 -y
echo c > C; hg add C; hg commit -m C
hg histedit
# C < A[D1] < B[D2]
moz-phab -b 1 -y --trace 

This results in:

...
rebasing 8:886084132361 "Bug 1 - A"
rebasing 9:b1f6928e442a "Bug 1 - B" (moz-phab_b1f6928e442a)
abort: hidden revision 'b1f6928e442abdddd4f812a874c2d5ec0431abcd' was rewritten as: 4c142195bfcc!
...

The error:

ERROR    2020-07-22 06:16:49,394 Traceback (most recent call last):
  File "/home/phab/review/mozphab/subprocess_wrapper.py", line 80, in check_output
    output = subprocess.check_output(command, **kwargs)
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['hg', '--config', 'extensions.rebase=', '--pager', 'never', '--config', 'rebase.experimental.inmemory=true', 'log', '-T', '{node}', '-r', 'parents(82a3caf96ff3909fb6aefbb3c4634a822c049c0f)']' returned non-zero exit status 255.
Priority: P3 → P2

The current way to submit the modified stack would be to submit the parent commit using --single option and then run moz-phab reorg.
In the simplified example (added D to make it necessary to use ranges of commits):

echo a > A; hg add A; hg commit -m A
echo b > B; hg add B; hg commit -m B
moz-phab -b 1 -y
# 4: A[D1] < 5: B[D2] 
# A and B are submitted to Phabricator as D1 and D2. D1 is the parent of D2.
echo c > C; hg add C; hg commit -m C
echo d > D; hg add D; hg commit -m D
# 4: A[D1] < 5: B[D2] < 6: C < 7: D
hg histedit
# 8: C < 9: A[D1] < 10: B[D2] < 11: D
moz-phab 8 -b 1 --single -y
# 12: C[D3] < 13: A[D1] < 14: B[D2] < 15: D
# C is now submitted to Phabricator as D3, but not related to D1.
moz-phab reorg 12 14

Which will provide such response:

Reorganisation based on 3 commits:
Stack will be reorganised:
 * D1 will depend on D3
Perform reorganisation (YES/No)?
Stack has been reorganised.

The error is in Mercurial::finalize method.
We iterate over each commit in the stack rebasing to get the commits back in order.
Notation: 10:A[D1] == rev:commit_name[Phabricator revision]

Before calling MozPhab the second time (after git histedit) we had the workspce:
7:C[] < 8:A[D1] < 9:B[D1]

During the submission process MozPhab amended the 7:C[] revision to add Phabricator URL to the summary.
In the finalize state (Mercurial::finalize()) the workspace contained hidden commit:

o  changeset:   10:C[D3]
|
| @  changeset:   9:B[D2]
| |
| *  changeset:   8:A[D1]
| |
| x  changeset:   7:C[]
|/  
|
o  changeset:   0:BASE

MozPhab started to rebase with 8:A[D1]. This moved also the 9:B[D2] and already looked like we want it to be finalized:

@  changeset:   12:B[D2]
|
o  changeset:   11:A[D1]
|
o  changeset:   10:C[D3]
|
o  changeset:   0:BASE

But the iteration https://github.com/mozilla-conduit/review/blob/master/mozphab/mercurial.py#L484-L490 wants to rebase again using the moved 8:B[D2] (hg rebase --source 8:B[D2] --dest 11:A[D1]) which results with an error.

Note: This iteration is required if all of the commits would be amended during the submission process.
Note2: Finalize stage is changing the SHA1 of an already submitted diff.

Assignee: pzalewa → nobody

I hit this bug again today.

Duplicate of this bug: 1858682
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: