can't clone the repo: ValueError: need more than 1 value to unpack

110 views
Skip to first unread message

Qijiang Fan

unread,
Apr 15, 2012, 2:07:06 AM4/15/12
to hg-...@googlegroups.com
This bug is originally reported at Debian BTS #636879

Version: hg-git 0.2.6

$ LANG=en_US.UTF-8 hg clone git://git.debian.org/git/pkg-kde/kde-std/calligra.git
destination directory: calligra
importing git objects into hg
** unknown exception encountered, please report by visiting
** Python 2.7.2+ (default, Nov 30 2011, 19:22:03) [GCC 4.6.2]
** Mercurial Distributed SCM (version 2.1.2)
** Extensions loaded: git
Traceback (most recent call last):
  File "/usr/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 27, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 64, in dispatch
    return _runcatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 87, in _runcatch
    return _dispatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 685, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 467, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 739, in _runcommand
    return checkargs()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 693, in checkargs
    return cmdfunc()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 682, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 456, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 1157, in clone
    branch=opts.get('branch'))
  File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 350, in clone
    destrepo.clone(srcrepo, heads=revs, stream=stream)
  File "/usr/lib/python2.7/dist-packages/mercurial/localrepo.py", line 2280, in clone
    return self.pull(remote, heads)
  File "/usr/lib/python2.7/dist-packages/hgext/git/hgrepo.py", line 14, in pull
    return git.fetch(remote.path, heads)
  File "/usr/lib/python2.7/dist-packages/hgext/git/git_handler.py", line 154, in fetch
    self.import_git_objects(remote_name, refs)
  File "/usr/lib/python2.7/dist-packages/hgext/git/git_handler.py", line 517, in import_git_objects
    self.import_git_commit(commit)
  File "/usr/lib/python2.7/dist-packages/hgext/git/git_handler.py", line 538, in import_git_commit
    hg_branch, extra) = self.extract_hg_metadata(commit.message)
  File "/usr/lib/python2.7/dist-packages/hgext/git/git_handler.py", line 967, in extract_hg_metadata
    command, data = line.split(" : ", 1)
ValueError: need more than 1 value to unpack


The line make it crash is:
(cherry picked from commit 341bff9346eb1fdf01b64d1a81883e2afaed90d5)
The previous line of it is:
extra : transplant_source : %5EE%85%C7X%A9%81m%A4%AF%F7%E4%13%269nv%2C%F3%A9


Patches(maybe):

Augie Fackler

unread,
Apr 15, 2012, 9:55:53 AM4/15/12
to hg-...@googlegroups.com
This is already fixed in tip. If you install from http://bitbucket.org/durin42/hg-git you should be fine.

On Apr 15, 2012, at 1:07 AM, Qijiang Fan wrote:

> This bug is originally reported at Debian BTS #636879<http://bugs.debian.org/636879>

> --
> You received this message because you are subscribed to the Google Groups "hg-git" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/hg-git/-/PEAC0YV9kpEJ.
> To post to this group, send email to hg-...@googlegroups.com.
> To unsubscribe from this group, send email to hg-git+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/hg-git?hl=en.
>

Qijiang Fan

unread,
Apr 20, 2012, 9:51:43 PM4/20/12
to hg-...@googlegroups.com
can you explain why the patch is 
+                if ' : ' in line:
+                    break
instead of 
+                if line.conut(' : ') == 0:
+                    continue
thanks



在 2012年4月15日星期日UTC+8下午9时55分53秒,Augie写道:

> To unsubscribe from this group, send email to hg-git+unsubscribe@googlegroups.com.

Augie Fackler

unread,
Apr 20, 2012, 9:53:05 PM4/20/12
to hg-...@googlegroups.com

On Apr 20, 2012, at 8:51 PM, Qijiang Fan wrote:

> can you explain why the patch is
>
> + if ' : ' in line:
> + break
>
> instead of
>
> + if line.conut(' : ') == 0:
> + continue
>
> thanks

using if … in string is more Pythonic.

We do break instead of continue because there's no reason to try and parse later lines: they're obviously not anything hg-git emitted.
>> hg-git+un...@googlegroups.com.
>>> For more options, visit this group at
>> http://groups.google.com/group/hg-git?hl=en.
>>>
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups "hg-git" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/hg-git/-/mKRWN7gkLtwJ.
> To post to this group, send email to hg-...@googlegroups.com.
> To unsubscribe from this group, send email to hg-git+un...@googlegroups.com.

Qijiang Fan

unread,
Apr 21, 2012, 1:18:22 PM4/21/12
to hg-...@googlegroups.com
one more question

line.count(' : ') == 0
has opposite meanings with
' : ' in line

could you please tell me which one is right ?


在 2012年4月21日星期六UTC+8上午9时53分05秒,Augie写道:
>>> For more options, visit this group at
>> http://groups.google.com/group/hg-git?hl=en.
>>>
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups "hg-git" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/hg-git/-/mKRWN7gkLtwJ.
> To post to this group, send email to hg-...@googlegroups.com.
> To unsubscribe from this group, send email to hg-git+unsubscribe@googlegroups.com.

Augie Fackler

unread,
Apr 21, 2012, 1:20:31 PM4/21/12
to hg-...@googlegroups.com, Sean Farley
(+Sean, who wrote the patch)
On Apr 21, 2012, at 12:18 PM, Qijiang Fan wrote:

> one more question
>
> *line.count(' : ') == 0*
> has *opposite* meanings with
> *' : ' in line*
>
> could you please tell me which one is right ?

You're quite right. I'll patch that presently.
>>>> hg-git+un...@googlegroups.com.
>>>>> For more options, visit this group at
>>>> http://groups.google.com/group/hg-git?hl=en.
>>>>>
>>>>
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>> Groups "hg-git" group.
>>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/hg-git/-/mKRWN7gkLtwJ.
>>> To post to this group, send email to hg-...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>> hg-git+un...@googlegroups.com.
>>> For more options, visit this group at
>> http://groups.google.com/group/hg-git?hl=en.
>>>
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups "hg-git" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/hg-git/-/0zhidRL27B0J.
> To post to this group, send email to hg-...@googlegroups.com.
> To unsubscribe from this group, send email to hg-git+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages