[Bug 5684] New: Wrapped ui doesn't clear progress bar when exception occurs

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Wed Sep 20 12:13:24 UTC 2017


https://bz.mercurial-scm.org/show_bug.cgi?id=5684

            Bug ID: 5684
           Summary: Wrapped ui doesn't clear progress bar when exception
                    occurs
           Product: Mercurial
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: mbthomas at fb.com
                CC: mercurial-devel at mercurial-scm.org

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.

I have a fix which I will submit shortly.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list