hgview crashes if repository is empty

Bug #662180 reported by grofaty
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
hgview (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: hgview

1. On Ubuntu 10.10 I have installed Mercurial and hgview:
sudo apt-get install mercurial
sudo apt-get install hgview

2. Then I have created repository:
hg init main
Note: main is the name of newly created repository.

3. Change directory to newly created directory.
cd main

4. Run hgview
hgview

Program crashed with the following error message in terminal:
===========
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/hgviewlib/qt4/hgrepoview.py", line 168, in resizeEvent
    self.resizeColumns()
  File "/usr/lib/pymodules/python2.6/hgviewlib/qt4/hgrepoview.py", line 183, in resizeColumns
    w = model.maxWidthValueForColumn(c)
  File "/usr/lib/pymodules/python2.6/hgviewlib/qt4/hgrepomodel.py", line 218, in maxWidthValueForColumn
    return _maxwidth[column](self, self.repo)
  File "/usr/lib/pymodules/python2.6/hgviewlib/qt4/hgrepomodel.py", line 89, in <lambda>
    key=lambda x: len(x))[-1],
IndexError: list index out of range
===========

It looks like if repository does not have at least one file and hgview is run, then hgview crashes.
Crash of the program should never happen. It would be nice if hgview would just start with empty windows.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: hgview 1.1.3-1
ProcVersionSignature: Ubuntu 2.6.35-22.34-generic 2.6.35.4
Uname: Linux 2.6.35-22-generic i686
Architecture: i386
Date: Sun Oct 17 16:03:52 2010
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=en_US:en
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: hgview

Revision history for this message
grofaty (grofaty) wrote :
Revision history for this message
grofaty (grofaty) wrote :

But is opened in upstream for 7 months at: http://www.logilab.org/ticket/20996

Revision history for this message
Julien Cristau (jcristau) wrote :

Fixed in the version in precise.

Changed in hgview (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.