1. alu
  2. hgtasks
Issue #28 open

Crash on hg push on Mercurial 1.5.3

bels
created an issue

I have attached a batch file which duplicates a problem when using hg push with the Tasks extension.

I am running: Windows Server 2008 Mercurial 1.5.3 with TortoiseHg 1.0.3

Mercurial.ini setup for Tasks:

[tasks]

auto.track.new = True

auto.stash = True

The full stack: {{{ C:\temp\repos\local\task-test2>hg push unknown exception encountered, details follow report bug details to http://mercurial.selenic.com/bts/ or mercurial@selenic.com Mercurial Distributed SCM (version 1.5.3) Extensions loaded: purge, clarifi, hgattic, share, bookmarks, tasks Traceback (most recent call last): File "hg", line 36, in <module> File "mercurial\dispatch.pyo", line 16, in run File "mercurial\dispatch.pyo", line 30, in dispatch File "mercurial\dispatch.pyo", line 50, in _runcatch File "mercurial\dispatch.pyo", line 470, in _dispatch File "mercurial\dispatch.pyo", line 340, in runcommand File "mercurial\dispatch.pyo", line 521, in _runcommand File "mercurial\dispatch.pyo", line 475, in checkargs File "mercurial\dispatch.pyo", line 469, in <lambda> File "mercurial\util.pyo", line 401, in check File "mercurial\extensions.pyo", line 116, in wrap File "mercurial\util.pyo", line 401, in check File "C:/Mercurial_extensions/tasks.py", line 1075, in taskspush outnodes = outgoingnodes(ui, repo, dest, opts) File "C:/Mercurial_extensions/tasks.py", line 1002, in outgoingnodes dest or 'default'), opts.get('rev')) ValueError: need more than 2 values to unpack }}}

Comments (9)

  1. mizipzor

    I ported the script to try it on Linux. It didnt crash but instead printed this when it tried to push at the end of the script:

    === moving on
    ['<\xc1\xa1!\x18\xbf\xd7*Ol\xf8\xcd:\xc1#o,\xee\x0c\x99', 
    'k\xef\xd1\xc34\x9c\xaa;\x96L\x03"R\xc7\xf3C\xed\x18"1', 
    '\xec\xa2\x08\xc2\xfa\x88\xe39<\xb4|\x91q^\xbf0\xa8G\xb2:']
    []
    ==========
    abort: pushing incomplete tasks
    (use --all-tasks to force or --completed-tasks to prune)
    

    Which was pretty much the output I expected. So I then added your specific settings to see if anything changed. The following lines were appended on my /.hgrc:

    [tasks]
    auto.track.new = True
    auto.stash = True
    

    But still no crash. This is with mercurial 1.4.3. My ported script is attached. It might be a Windows only thing. But I would suggest to begin by testing what happens if you remove all extensions except for hgtasks to see if there is a conflict between the extensions.

  2. bels reporter

    I just re-ran it with only the Tasks extension enabled, as you suggested. I got the same error though, so no luck there. I will try it again using the same Mercurial version as you, 1.4.3, and with only Tasks present. Perhaps something changed between 1.4.3 and 1.5.3 that causes it to bomb.

    ** unknown exception encountered, details follow
    ** report bug details to http://mercurial.selenic.com/bts/
    ** or mercurial@selenic.com
    ** Mercurial Distributed SCM (version 1.5.3)
    ** Extensions loaded: tasks
    Traceback (most recent call last):
      File "hg", line 36, in <module>
      File "mercurial\dispatch.pyo", line 16, in run
      File "mercurial\dispatch.pyo", line 30, in dispatch
      File "mercurial\dispatch.pyo", line 50, in _runcatch
      File "mercurial\dispatch.pyo", line 470, in _dispatch
      File "mercurial\dispatch.pyo", line 340, in runcommand
      File "mercurial\dispatch.pyo", line 521, in _runcommand
      File "mercurial\dispatch.pyo", line 475, in checkargs
      File "mercurial\dispatch.pyo", line 469, in <lambda>
      File "mercurial\util.pyo", line 401, in check
      File "mercurial\extensions.pyo", line 116, in wrap
      File "mercurial\util.pyo", line 401, in check
      File "C:/Mercurial_extensions/tasks.py", line 1075, in taskspush
        outnodes = outgoingnodes(ui, repo, dest, **opts)
      File "C:/Mercurial_extensions/tasks.py", line 1002, in outgoingnodes
        dest or 'default'), opts.get('rev'))
    ValueError: need more than 2 values to unpack
    
  3. bels reporter

    It appears to be a 1.4.3 vs. 1.5.3 issue. I just installed 1.4.3 and ran the same script and I got the expected error/message about having incomplete tasks:

    C:\temp\repos\local\task-test2>C:\Applications\Mercurial\hg.exe push
    abort: pushing incomplete tasks
    (use --all-tasks to force or --completed-tasks to prune)
    
        ...snip...
    
    C:\temp>C:\Applications\Mercurial\hg.exe --version
    Mercurial Distributed SCM (version 1.4.3+20100201)
    
    Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> and others
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
  4. bobpaul

    This should fix it and was tested against remote.sh on 1.6.4. Hopefully I didn't break compatibility on 1.4 or 1.5 or add regressions.

    One thing I'm not sure on is in "outgoingnodes()". As explained in commit 10369:d757bc0c7865 in the hg-stable repo, parseurl used to return (dest, revs, checkout) but now returns (dest, (branch, branches)). I'm not sure if repo.lookup() should be run on branch, just like it was being run on rev and I'm also not sure if we should iterate on branches or what to do if we did.

  5. bobpaul

    Alright, sorry for the bug spam.

    I looked at killermonk's more closely and decided I didn't like his dropping compatibility for older mercurial's, especially since he left that try/except group in to allow an hg 1.2.x API.

    This patch elegantly handles multiple revisions; all of the 1.6 code is in the top try and multiple excepts catch the various other versions. Like killermonk's, it calls "hg.addbranchrevs" which is the proper way to turn (branch, branches) into (revs, checkout). Again, I've only tested on 1.6.4, but I believe I handled old mercurials properly.

  6. alu repo owner
    • changed status to open

    bobpaul, I've pulled from killermonk's fork.

    the last patch you attached here is a patch against your own code?

    I'm not sure about keeping compatibility with previous revisions as we will be fixing bugs and adding new functionality in the future which will not care about previous versions. And we don't need separate version branches for lil ol' hgtasks :)

    Would you mind showing me a patch that works against the current tip of this repo? (58: 886ac614b940)

    Thanks!

  7. Log in to comment