Bundle reading fails for bundle created on Windows

Bug #49930 reported by Michael Ellerman
This bug report is a duplicate of:  Bug #49182: bundle reader too sensitive. Edit Remove
2
Affects Status Importance Assigned to Milestone
Bazaar
Invalid
Undecided
Unassigned

Bug Description

I have a bundle which when I try to merge I get:

concordia ~/src/bzr/plugins/shelf$ bzr merge ~/Desktop/shelf-win32-fixes.patch
bzr: ERROR: exceptions.TypeError: float() argument must be a string or a number
  at /home/michael/src/bzr/mirrors/trunk/bzrlib/bundle/read_bundle.py line 49
  in as_revision

This is because timestamp is None in as_revision(). It looks like it should be filled in in comple_info(), but that's not happening because date is None also. Not sure how that's happening.

bzr.log:
got branch format Bazaar-NG Metadir branch format 5
_handle_next u'message' => [u'win32 workaround for renaming to already existing file']
_handle_next u'committer' => u'Alexander Belchenko <email address hidden>'
_handle_next u'date' => u'Thu 2006-06-15 14:11:24.247999907 +0300'
_handle_next u'revision_id' => <email address hidden>'_handle_next u'sha1' => u'82951efa95a01e363f2665309db93f5ddd979a2f'
_handle_next u'inventory_sha1' => u'd2a8b86c948f6030403504a2087b5eea234be876'
_handle_next u'parent_ids' => [<email address hidden>']
_handle_next u'base_id' => <email address hidden>'
_handle_next u'properties' => [u'branch-nick: shelf.bialix']
_handle_next u'message' => [u'[win32] run patch utility with --binary flag on win32 to avoid problems with line-endings']
_handle_next u'committer' => u'Alexander Belchenko <email address hidden>'
_handle_next u'date' => u'Thu 2006-06-15 14:00:55.914999962 +0300'
_handle_next u'revision_id' => <email address hidden>'_handle_next u'sha1' => u'98c6486921e5cc69b56b58a8c3d05304119e1233'
_handle_next u'inventory_sha1' => u'ab0bb53339502654b5391147dd330faa007c7137'
_handle_next u'parent_ids' => [<email address hidden>']
_handle_next u'properties' => [u'branch-nick: shelf.bialix']
_handle_next u'message' => [u'fix import and usage of msvcrt to get user input on win32']
_handle_next u'committer' => u'Alexander Belchenko <email address hidden>'
_handle_next u'date' => u'Thu 2006-06-15 13:33:19.362999916 +0300'
_handle_next u'revision_id' => <email address hidden>'_handle_next u'sha1' => u'08d8d720db749090d976fdcc6a056693a2e721ad'
_handle_next u'inventory_sha1' => u'd11e1b4a66e16934f1c6a3777903213782ab02de'
_handle_next u'parent_ids' => [<email address hidden>']
_handle_next u'properties' => [u'branch-nick: shelf.bialix']
[10044] Fri 11:35:53.483 ERROR: exceptions.TypeError: float() argument must be a string or a number
  at /home/michael/src/bzr/mirrors/trunk/bzrlib/bundle/read_bundle.py line 49
  in as_revision
Traceback (most recent call last):
  File "/home/michael/src/bzr/mirrors/trunk/bzrlib/commands.py", line 698, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/michael/src/bzr/mirrors/trunk/bzrlib/commands.py", line 658, in run_bzr
    ret = run(*run_argv)
  File "/home/michael/src/bzr/mirrors/trunk/bzrlib/commands.py", line 290, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/michael/src/bzr/mirrors/trunk/bzrlib/builtins.py", line 2057, in run
    reader = BundleReader(file(branch, 'rb'))
  File "/home/michael/src/bzr/mirrors/trunk/bzrlib/bundle/read_bundle.py", line 175, in __init__
    self._validate()
  File "/home/michael/src/bzr/mirrors/trunk/bzrlib/bundle/read_bundle.py", line 192, in _validate
    self.info.complete_info()
  File "/home/michael/src/bzr/mirrors/trunk/bzrlib/bundle/read_bundle.py", line 115, in complete_info
    self.real_revisions.append(rev.as_revision())
  File "/home/michael/src/bzr/mirrors/trunk/bzrlib/bundle/read_bundle.py", line 49, in as_revision
    timestamp=float(self.timestamp),
TypeError: float() argument must be a string or a number

I'll attach the offending bundle in a sec.

Revision history for this message
Michael Ellerman (michael-ellerman) wrote : Bundle which fails to merge.

Bundle which fails to merge.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: Bundle reading fails in RevisionInfo.as_revision()

this bundle was created with somewhat old version of bzr.dev before Aaron make bzse-64 encoding of tail of bundle.

Revision history for this message
Alexander Belchenko (bialix) wrote :

err, sorry for typo. 'base-64 encoding', of course

Revision history for this message
Michael Ellerman (michael-ellerman) wrote : Updated bundle that still fails.

This is a bundle created with the latest bzr.dev (including base-64 encoding of secondary diffs), which still fails.

Revision history for this message
John A Meinel (jameinel) wrote :

The problem is the trailing newlines at the bottom. The current reader is trying to start a new revision, but there are no content lines.

Try just removing a few lines at the bottom, so that you only have 1 blank line. (You must have 1)

Revision history for this message
Michael Ellerman (michael-ellerman) wrote :

Removing the last line fixed it. So this is just a sensitivity to whitespace problem -> dup of #49182.

Changed in bzr:
status: Unconfirmed → Rejected
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.