diff --git a/mercurial/shelve.py b/mercurial/shelve.py --- a/mercurial/shelve.py +++ b/mercurial/shelve.py @@ -625,7 +625,7 @@ def listshelves(repo): info = [] seen = set() for (filename, _type) in names: - name, ext = filename.rsplit(b'.', 1) + name = filename.rsplit(b'.', 1)[0] if name in seen: continue seen.add(name) diff --git a/tests/test-shelve2.t b/tests/test-shelve2.t --- a/tests/test-shelve2.t +++ b/tests/test-shelve2.t @@ -779,10 +779,10 @@ Test corrupt shelves (in .hg/shelved/, n # A file with an unexpected extension $ touch .hg/shelved/junk3 - $ hg shelve -l 2>&1 | grep ValueError - ValueError: not enough values to unpack (expected 2, got 1) - $ hg unshelve 2>&1 | grep ValueError - ValueError: not enough values to unpack (expected 2, got 1) + $ hg shelve -l + $ hg unshelve + abort: no shelved changes to apply! + [20] $ hg shelve -d junk3 abort: shelved change 'junk3' not found [10]