Pull error in hg_delta_editor with KeyError

Create issue
Issue #105 resolved
Sean Russell created an issue

This is with hgsubversion ff69f1855086 (Jul 6) and hg b81baf9e4dd6.

The repository has been used to pull and push for a couple of months over several dozen revisions, with no trouble. On a recent clean pull (no pending outgoing changes), the pull failed with:

{{{ dx325002tp% hg pull -u [r10309] apavlin: This branch was created incorrectly. Removing it so it can be unknown exception encountered, details follow report bug details to http://mercurial.selenic.com/bts/ or mercurial@selenic.com Mercurial Distributed SCM (version b81baf9e4dd6) Extensions loaded: hgk, extdiff, transplant, graphlog, fetch, convert, mq, churn, svn, rebase, hgattic, patchbomb, record Traceback (most recent call last): File "/usr/local/bin/hg", line 27, in <module> mercurial.dispatch.run() File "/usr/local/lib/python2.6/dist-packages/mercurial/dispatch.py", line 16, in run sys.exit(dispatch(sys.argv[1:])) File "/usr/local/lib/python2.6/dist-packages/mercurial/dispatch.py", line 27, in dispatch return _runcatch(u, args) File "/usr/local/lib/python2.6/dist-packages/mercurial/dispatch.py", line 43, in _runcatch return _dispatch(ui, args) File "/usr/local/lib/python2.6/dist-packages/mercurial/dispatch.py", line 449, in _dispatch return runcommand(lui, repo, cmd, fullargs, ui, options, d) File "/usr/local/lib/python2.6/dist-packages/mercurial/dispatch.py", line 317, in runcommand ret = _runcommand(ui, options, cmd, d) File "/usr/local/lib/python2.6/dist-packages/mercurial/dispatch.py", line 501, in _runcommand return checkargs() File "/usr/local/lib/python2.6/dist-packages/mercurial/dispatch.py", line 454, in checkargs return cmdfunc() File "/usr/local/lib/python2.6/dist-packages/mercurial/dispatch.py", line 448, in <lambda> d = lambda: util.checksignature(func)(ui, *args, cmdoptions) File "/usr/local/lib/python2.6/dist-packages/mercurial/util.py", line 370, in check return func(args, kwargs) File "/usr/local/lib/python2.6/dist-packages/mercurial/extensions.py", line 103, in wrap util.checksignature(origfn), *args, kwargs) File "/usr/local/lib/python2.6/dist-packages/mercurial/util.py", line 370, in check return func(args, kwargs) File "/usr/local/lib/python2.6/dist-packages/hgext/rebase.py", line 446, in pullrebase orig(ui, repo, *args, opts) File "/usr/local/lib/python2.6/dist-packages/mercurial/util.py", line 370, in check return func(args, kwargs) File "/usr/local/lib/python2.6/dist-packages/mercurial/extensions.py", line 103, in wrap util.checksignature(origfn), *args, kwargs) File "/usr/local/lib/python2.6/dist-packages/mercurial/util.py", line 370, in check return func(args, **kwargs) File "/home/srussell/hgsubversion/wrappers.py", line 307, in pull File "/home/srussell/hgsubversion/hg_delta_editor.py", line 526, in update_branch_tag_map_for_rev File "/home/srussell/hgsubversion/hg_delta_editor.py", line 457, in __determine_parent_branch KeyError: 'SCOUT_2100_014' }}}

The tag exists (hasn't been deleted):

{{{ dx325002tp% svn log --stop-on-copy http://svnserver/repos/scout/tags/SCOUT_2100_014


r9362 | apavlin | 2009-01-23 11:46:10 -0500 (Fri, 23 Jan 2009) | 3 lines

Add build tag.

}}}

I also verified that the tag was not re-created. However, the change set that the pull fails on (r10309 in SVN) deletes a branch that was made from a different tag (SCOUT_1010_014); the next SVN change set (r10310) re-creates the branch from the tag that is being reported by the KeyError (SCOUT_2100_014).

I will try to replicate this on a dummy repository; if I'm successful, I'll post steps to re-create here.

Comments (4)

  1. Sean Russell reporter

    Hm. I didn't even get that far:

    dx325002tp% hg clone svn+http://nightrider/repos/temp temp-hg
    [r1] srussell: 1
    [r3] srussell: 3
    [r4] srussell: 4
    ** report bug details to http://mercurial.selenic.com/bts/
    ** or mercurial@selenic.com
    ** Extensions loaded: hgk, extdiff, transplant, graphlog, fetch, convert, mq, churn, svn,
    rebase, hgattic, patchbomb, record
      File "/usr/local/bin/hg", line 27, in <module>
        mercurial.dispatch.run()
        sys.exit(dispatch(sys.argv[1:]))
      File "/usr/local/lib/python2.6/dist-packages/mercurial/dispatch.py", line 27, in dispatc
    h
        return _runcatch(u, args)
      File "/usr/local/lib/python2.6/dist-packages/mercurial/dispatch.py", line 43, in _runcat
    ch
        return _dispatch(ui, args)
      File "/usr/local/lib/python2.6/dist-packages/mercurial/dispatch.py", line 449, in _dispa
    tch
        return runcommand(lui, repo, cmd, fullargs, ui, options, d)
    mand
      File "/usr/local/lib/python2.6/dist-packages/mercurial/dispatch.py", line 501, in _runco
    mmand
        return checkargs()                                                                    
      File "/usr/local/lib/python2.6/dist-packages/mercurial/dispatch.py", line 454, in checka
    rgs                                                                                       
        return cmdfunc()                                                                      
      File "/usr/local/lib/python2.6/dist-packages/mercurial/dispatch.py", line 448, in <lambd
    a>                                                                                        
        d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)                        
      File "/usr/local/lib/python2.6/dist-packages/mercurial/util.py", line 370, in check     
        return func(*args, **kwargs)                                                          
      File "/usr/local/lib/python2.6/dist-packages/mercurial/extensions.py", line 103, in wrap
        util.checksignature(origfn), *args, **kwargs)                                         
      File "/usr/local/lib/python2.6/dist-packages/mercurial/util.py", line 370, in check     
        return func(*args, **kwargs)                                                          
      File "/home/srussell/hgsubversion/wrappers.py", line 209, in clone                      
      File "/home/srussell/hgsubversion/wrappers.py", line 307, in pull                       
      File "/home/srussell/hgsubversion/hg_delta_editor.py", line 526, in update_branch_tag_ma
    p_for_rev                                                                                 
      File "/home/srussell/hgsubversion/hg_delta_editor.py", line 457, in __determine_parent_b
    ranch                                                                                     
    KeyError: '1'
    dx325002tp%
    

    This from a repository made with:

    dx325002tp% svnadmin create temp
    dx325002tp% svn co file:/`pwd`/temp mytemp
    svn: Unable to open an ra_local session to URL
    svn: Local URL 'file://home/srussell/temp' contains unsupported hostname
    dx325002tp% svn co file://`pwd`/temp mytemp
    Checked out revision 0.
    dx325002tp% cd mytemp
    dx325002tp% svn mkdir branches
    A         branches
    dx325002tp% svn mkdir tags
    A         tags
    dx325002tp% svn ci -m "1"
    Adding         branches
    Adding         tags
    
    Committed revision 1.
    dx325002tp% svn mkdir trunk
    A         trunk
    dx325002tp% svn ci -m "2"
    Adding         trunk
    
    Committed revision 2.
    dx325002tp% svn cp trunk tags/1
    A         tags/1
    dx325002tp% svn cp trunk tags/2
    A         tags/2
    dx325002tp% svn revert tags/2
    Reverted 'tags/2'
    dx325002tp% svn ci -m "3"
    Adding         tags/1
    
    Committed revision 3.
    dx325002tp% svn cp trunk tags/2
    svn: 'tags/2' is not a working copy
    dx325002tp% rm -rf tags/2
    dx325002tp% svn cp trunk tags/2
    A         tags/2
    dx325002tp% svn ci -m "4"
    Adding         tags/2
    
    Committed revision 4.
    dx325002tp% svn cp 1 branches/A
    svn: Path '1' does not exist
    dx325002tp% svn cp tags/1 branches/A
    A         branches/A
    dx325002tp% svn ci -m "5"
    Adding         branches/A
    
    Committed revision 5.
    

    It looks like with this combination of hgsubversion and mercurial versions, tags are not being handled correctly, and we're unable to create branches from tags.

  2. Augie Fackler repo owner

    Can you try this again with tip hgsubversion and report back? If it still happens, we can look into it in more detail.

  3. Former user Account Deleted

    Yes. This appears to be fixed. I'm getting further, but am still being stopped from a full pull due to other exceptions. I'll look for, or file, a PR about this other issue, so this one can be closed.

  4. Log in to comment