This is an archive of the discontinued Mercurial Phabricator instance.

ui: check for progress singleton when clearing progress bar (issue5684)
ClosedPublic

Authored by mbthomas on Sep 20 2017, 8:16 AM.

Details

Summary

A combination of wrapping ui and progress bars interrupted by exceptions can
lead to the progress bar not being cleared when the exception error is printed.
This results in corrupted-looking output like this:

updating [===============================>                        ] 1/2u
nresolved conflicts (see hg resolve, then hg rebase --continue)

This is because in ui._progclear, we only check the local reference to the
progress bar, not whether or not there is an instance of the singleton. When a
progress bar is interrupted by an exception, the exception printing in
scmutil.callcatch uses the original instance of the ui object, not the
wrapped copy that has _progbar set.

When consider whether or not to clear the progress bar, check for the existence
of the singleton, rather than just whether or not we have a local reference to
it.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mbthomas created this revision.Sep 20 2017, 8:16 AM
durin42 requested changes to this revision.Sep 20 2017, 12:32 PM
durin42 added a subscriber: durin42.

Fails test-subrepo-deep-nested-change.t, but otherwise looks good. Fix up test failures? (I think you just need to update the expected behavior.)

This revision now requires changes to proceed.Sep 20 2017, 12:32 PM
mbthomas updated this revision to Diff 1939.Sep 20 2017, 12:59 PM
krbullock accepted this revision.Sep 30 2017, 8:00 AM

Queued for stable, thanks.

This revision was automatically updated to reflect the committed changes.