Bug 5783 - ValueError (too many values to unpack) in mercurial/obsolete.py
Summary: ValueError (too many values to unpack) in mercurial/obsolete.py
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: evolution (show other bugs)
Version: stable branch
Hardware: PC Linux
: wish bug
Assignee: Bugzilla
URL:
Keywords: easy
Depends on:
Blocks:
 
Reported: 2018-02-07 12:30 UTC by David Douard
Modified: 2018-10-16 00:00 UTC (History)
5 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Douard 2018-02-07 12:30 UTC
In a repository (in which we use obsolete and evolve and topics), we've been hit by the traceback :

[...]
  File "/home/david/.virtualenvs/hg/local/lib/python2.7/site-packages/mercurial/obsolete.py", line 296, in _fm0decodemeta
    key, value = l.split(':')
ValueError: too many values to unpack

In my context, the variable 'l' contains 2 ':' chars. The content of the variabel 'data' in this function is:

'date:1518013344.878793 -3600\x00ef1:0\x00note:6c95ca::a1e17f\x00p1:ed7673f73387b36521da58a87f08e02e4a795ded\x00user:Denis Laxalde <xxx@yyy.zz>'

I mage a simple hotfix replacing this line by:

  key, value = l.split(':', 1)

which seems to work for now.

Note: the problem occurs the same on hg 4.3 (deb package on a jessie machine) and hg 4.5 (from pip).

David
Comment 1 Yuya Nishihara 2018-02-08 07:42 UTC
Looks like that.

FYI, it appears you're using old (i.e. slower) obsstore format.
Comment 2 David Douard 2018-02-08 11:02 UTC
Yes I have not converted all hg repos we have here, we have *many* repos on several machines, and some of them are very old and very early-adopter of the Great Evolve Stuff!
Comment 3 Pulkit Goyal 2018-07-03 09:07 UTC
Fixing this will require making changes somewhere in this function https://www.mercurial-scm.org/repo/hg/file/tip/mercurial/obsolete.py#l273.

I will be happy to mentor to fix this bug. I am pulkit on #mercurial, ping me if you need help.
Comment 4 HG Bot 2018-10-08 12:25 UTC
Fixed by https://mercurial-scm.org/repo/hg/rev/a4d62ff9a86d
Zharaskhan Aman <aman.zharaskhan@gmail.com>
obsolete: fix ValueError when stored note contains ':' char (issue5783)

The newer version of `amend -n 'Some some'` accepts containing ':' char.

The information contained in this note 'Testing::Obstore' gives ValueError,
because we are trying to store more than 2 values in key and value.

Differential Revision: https://phab.mercurial-scm.org/D4883
Differential Revision: https://phab.mercurial-scm.org/D4882

(please test the fix)
Comment 5 Bugzilla 2018-10-16 00:00 UTC
Bug was set to TESTING for 7 days, resolving