hg collapse fails with "ValueError: need more than 1 value to unpack"

Issue #10 open
created an issue

This is the traceback I've got:

$ hg collapse -r 352:354
adding ConfigurationGenerator/README
reverting ConfigurationGenerator/src/main/resources/xml/mcc_ms_1_0_0.xml
** Unknown exception encountered with possibly-broken third-party extension collapse
** which supports versions unknown of Mercurial.
** Please disable collapse and try your action again.
** If that fixes the bug please report it to the extension author.
** Python 2.7.3 (default, Sep 26 2013, 20:08:41) [GCC 4.6.3]
** Mercurial Distributed SCM (version 2.7.2)
** Extensions loaded: collapse, mercurial_keyring, histedit, hgshelve, activity, transplant, rebase, graphlog, color, mq, keyword
Traceback (most recent call last):
  File "/usr/bin/hg", line 38, in <module>
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 28, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 69, in dispatch
    ret = _runcatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 97, in _runcatch
    return _dispatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 778, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 549, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 188, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/hgext/color.py", line 412, in colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 869, in _runcommand
    return checkargs()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 840, in checkargs
    return cmdfunc()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 775, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 507, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 143, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 507, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/hgext/mq.py", line 3533, in mqcommand
    return orig(ui, repo, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 507, in check
    return func(*args, **kwargs)
  File "/home/andi/bin/hg-extensions/hgcollapse/hgext/collapse.py", line 77, in collapse
  File "/home/andi/bin/hg-extensions/hgcollapse/hgext/collapse.py", line 173, in do_collapse
    fix_hgtags(ui, repo, head_hgtags, tagsmap)
  File "/home/andi/bin/hg-extensions/hgcollapse/hgext/collapse.py", line 347, in fix_hgtags
    (nodehex, name) = line.split(" ", 1)
ValueError: need more than 1 value to unpack

Comments (5)

  1. Peer Stritzinger repo owner

    Unfortunately the collapse extension regularly runs into incompatibilities with newer Mercurial versions. This is probably caused by the way its written (not by me ... I just took over maintenance and added a few features ... but don't have much time for it recently)

    I did add a test suite though (the original collapse had zero tests) to ease maintaining patches.

    Pull requests with passing tests welcome.

  2. Seb Em

    I had this error too. rebase does not seem to allow collapse when everything is flat already ("nothing to rebase"). Digging deeper, I found the error was coming from an empty line in my .hgtags file. Removing it solved the problem. I guess the "if not line" check on line 345 doesn't detect this as it wanted, because of the newline not stripped (yet).

  3. Peer Stritzinger repo owner
    • changed status to open

    Thanks Seb for the analysis

    This is not a compatibility issue but caused by empty lines in .hgtags which are not handled correctly. Quick workaround is to remove empty lines from .hgtags

    Will fix as soon as I have a timeslot

  4. Log in to comment