[issue183] pulling from an empty repository gets an abort, w/patch

Jim Meyering mercurial-bugs at selenic.com
Mon Mar 27 09:37:08 UTC 2006


New submission from Jim Meyering <list+hg at meyering.net>:

`hg pull' from an empty repository gets `abort'

cd /tmp && mkdir t1 && cd t1 && hg init
cd /tmp && mkdir t2 && cd t2 && hg init && hg pull ../t1

Here's the output I see:
-----------------------

pulling from ../t1
requesting all changes
adding changesets
** unknown exception encountered, details follow
** report bug details to mercurial at selenic.com
** Mercurial Distributed SCM (version 182f500805db+20060327)
Traceback (most recent call last):
  File "/p/bin/hg", line 14, in ?
    commands.run()
  File "/p/p/hg-2006-03-27.10h50/lib/python/mercurial/commands.py", line 3055,
in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/p/p/hg-2006-03-27.10h50/lib/python/mercurial/commands.py", line 3227,
in dispatch
    return d()
  File "/p/p/hg-2006-03-27.10h50/lib/python/mercurial/commands.py", line 3202,
in <lambda>
    d = lambda: func(u, repo, *args, **cmdoptions)
  File "/p/p/hg-2006-03-27.10h50/lib/python/mercurial/commands.py", line 2117,
in pull
    r = repo.pull(other, heads=revs, force=opts['force'])
  File "/p/p/hg-2006-03-27.10h50/lib/python/mercurial/localrepo.py", line 973,
in pull
    return self.addchangegroup(cg)
  File "/p/p/hg-2006-03-27.10h50/lib/python/mercurial/localrepo.py", line 1370,
in addchangegroup
    cn = cl.addgroup(chunkiter, csmap, tr, 1) # unique
  File "/p/p/hg-2006-03-27.10h50/lib/python/mercurial/revlog.py", line 764, in
addgroup
    for chunk in revs:
  File "/p/p/hg-2006-03-27.10h50/lib/python/mercurial/changegroup.py", line 32,
in chunkiter
    c = getchunk(source)
  File "/p/p/hg-2006-03-27.10h50/lib/python/mercurial/changegroup.py", line 16,
in getchunk
    d = source.read(4)
  File "/p/p/hg-2006-03-27.10h50/lib/python/mercurial/util.py", line 742, in read
    for chunk in self.in_iter:
  File "/p/p/hg-2006-03-27.10h50/lib/python/mercurial/localrepo.py", line 1338,
in gengroup
    self.hook('outgoing', node=hex(nodes[0]), source=source)
IndexError: list index out of range
transaction abort!
rollback completed
-----------------------------------
Here's the fix:

2006-03-27  Jim Meyering  <jim at meyering.net>

	* localrepo.py (localrepository.pull): When pulling from an
	empty repository, work the same way as when pulling nothing
	from a non-empty repository.

BTW, the problem I reported here:
    http://www.selenic.com/pipermail/mercurial/2006-March/007033.html
  better patch here:
    http://www.selenic.com/pipermail/mercurial/2006-March/007049.html

remains, and still blocks use of vc-hg.el.  Is there anything
else I can provide?

----------
files: k
messages: 833
nosy: meyering
priority: bug
status: unread
title: pulling from an empty repository gets an abort, w/patch

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue183>
____________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: k
Type: application/octet-stream
Size: 503 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20060327/a1082dd4/attachment-0001.obj>


More information about the Mercurial mailing list