ValueError: need more than 1 value to unpack

Bug #230341 reported by Stéphane Raimbault
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
svn2bzr
Fix Committed
High
Martin Spacek

Bug Description

svn2bzr.py (revno 13 from trunk) fails with a dump available on the svn2bzr-ddaa branch.
A personal Subversion dump give me the same error.

./svn2bzr.py ../svn2bzr-ddaa/testdata/ignore.dump ignore

Revision 0 read
Traceback (most recent call last):
  File "./svn2bzr.py", line 1083, in <module>
    main()
  File "./svn2bzr.py", line 1076, in main
    opts.prefix, opts.filter)
  File "./svn2bzr.py", line 996, in svn2bzr
    dump = Dump(dump_file)
  File "./svn2bzr.py", line 662, in __init__
    self._read()
  File "./svn2bzr.py", line 899, in _read
    field, value = line.split(': ', 1)
ValueError: need more than 1 value to unpack

The _read function is a bit complex for me :)

Revision history for this message
Jan Kneschke (jan-kneschke) wrote :

After adding some extra debug after the while line: ... the split is failing on:

  Node-path:

without a trailing space.

Revision history for this message
Henrik Johansson (dahankzter) wrote :

I get the same error but only on Windows, on the Linux box it works fine.

Revision history for this message
Scott Wegner (swegner) wrote :

I'm hitting a similar error when trying to import my own svn branch. It appears that svn2bzr is not set up to handle property changes on the root directory. The entry in svn.dump that it's crashing on looks like:

Node-path:
Node-kind: dir
Node-action: change
Prop-content-length: 105
Content-length: 105

K 10
svn:ignore
V 73
configure
Makefile.in
autom4te.cache
missing
install-sh
aclocal.m4
*.tmp

PROPS-END

It appears to expect something after "Node-path ", and thus crashes.

I'm using svn2bzr from the current devel via `bzr branch lp:svn2bzr`. I'm not Ubuntu 8.10 x64 with the latest updated bzr, svnadmin, python, etc. Let me know if there's anything else I can provide. The import command I am using is:

./svn2bzr.py --scheme=single --log=debug svn.dump bzr

Revision history for this message
Scott Wegner (swegner) wrote :

Sorry, should have proof-read. In my comment above, the last paragraph, "... I'm *on* Ubuntu 8.10 x64 with ..."

Revision history for this message
Dave Suffling (dsufflin) wrote :

Can confirm this issue is in trunk (r13) as of Mar 31 01:10 UTC.

Ubuntu 8.10 (x86-32)/Intel Core 2 Quad Q6600/6GiB RAM.

I've attached a patch which should work around (though not solve) the issue. (I'm new to Bazaar -- as my commenting on this bug might suggest. As the bazaar merge directive seems a little small to have been correctly produced, I've included diff output as well.)

Revision history for this message
Martin Spacek (mspacek) wrote :

I had both of the same problems (the ValueError, and not handling prop changes to svn root dir) a while ago. I fixed the first problem. For the second one, I was a bit worried about breaking things for others, so I added a descriptive error message, prompting the user to slightly modify their dump file:

Your dump file has a node that's trying to change something about the empty root path '' in your svn repo. Try adding the following just before the line that says 'Revision-number: 1' near the start of your dump file (make sure your text editor doesn't strip trailing whitespaces from lines or otherwise change line endings when saving to the dump file):

Node-path:
Node-kind: dir
Node-action: add
Prop-content-length: 10
Content-length: 10

PROPS-END

Does the latest trunk (rev21) solve the problem?

Changed in svn2bzr:
assignee: nobody → mspacek
importance: Undecided → High
status: New → Confirmed
Martin Spacek (mspacek)
Changed in svn2bzr:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.