bzr merge fails on control characters in filenames

Bug #407303 reported by Gavin Carr
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Invalid
Undecided
Unassigned

Bug Description

I'm seeing a merge failure under bzr 1.17 (on linux), which I'm guessing is due to weird characters in filenames.

I've got a feature branch I'm trying to merge to mainline, so it's all committed fine, and 'bzr missing' works, but the merge fails:

  nox:~/work/brackup/upstream$ bzr merge -v -v ../escape
  bzr: ERROR: not well-formed (invalid token): line 90, column 81

bzr st then shows no changes.

The feature branch is testing escaping of weird filename characters, which I suspect is the cause of the problem. The unit test data directory looks like:

  nox:~/work/brackup/escape$ tree t/data_weird_filenames/
  t/data_weird_filenames/
  |-- 000-dup1.txt
  |-- 000-dup2.txt
  |-- filename^Lformfeed
  |-- filename^Mcarriage^Mreturn
  |-- filename whitespace
  |-- filename_ctrl_c^C
  |-- filename_newline
  |-- filename_tab
  |-- huge-file.txt
  |-- my-link.txt -> test-file.txt
  `-- my_^Ldir
      `-- sub_dir
          |-- another-file.txt
          `-- program.sh

where those are real control characters in the filenames (yes, not something you'd normally do!), and adding this data seems to be what's causing the problem (I've merged all the previous revisions fine).

Trackback is:
Fri 2009-07-31 18:13:01 +1000
0.017 bzr arguments: [u'merge', u'-r50', u'../escape']
0.035 looking for plugins in /home/gavin/.bazaar/plugins
0.035 looking for plugins in /usr/lib/python2.4/site-packages/bzrlib/plugins
0.154 opening working tree '/home/gavin/work/brackup/upstream'
0.195 Using fetch logic to copy between KnitPackRepository('file:///home/gavin/work/brackup/escape/.bzr/repository/')(<RepositoryFormatKnitPack1>) and KnitPackRepository('file:///home/gavin/bzre/.bzr/repository/')(<RepositoryFormatKnitPack1>)
0.195 fetch up to rev {<email address hidden>}
0.266 Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 835, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 1030, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 647, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line 3683, in run
    location, revision, remember, possible_transports, pb)
  File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line 3790, in _get_merger_from_branch
    other_revision_id, base_revision_id, other_branch, base_branch)
  File "/usr/lib/python2.4/site-packages/bzrlib/merge.py", line 204, in from_revision_ids
    merger.set_other_revision(other, other_branch)
  File "/usr/lib/python2.4/site-packages/bzrlib/merge.py", line 344, in set_other_revision
    self.other_tree = self.revision_tree(revision_id)
  File "/usr/lib/python2.4/site-packages/bzrlib/merge.py", line 220, in revision_tree
    tree = branch.repository.revision_tree(revision_id)
  File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/repository.py", line 2363, in revision_tree
    inv = self.get_revision_inventory(revision_id)
  File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/repository.py", line 2322, in get_revision_inventory
    return self.get_inventory(revision_id)
  File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/repository.py", line 2179, in get_inventory
    return self.iter_inventories([revision_id]).next()
  File "/usr/lib/python2.4/site-packages/bzrlib/repository.py", line 2199, in _iter_inventories
    yield self.deserialise_inventory(revision_id, text)
  File "/usr/lib/python2.4/site-packages/bzrlib/repository.py", line 2221, in deserialise_inventory
    entry_cache=self._inventory_entry_cache)
  File "/usr/lib/python2.4/site-packages/bzrlib/xml_serializer.py", line 77, in read_inventory_from_string
    raise errors.UnexpectedInventoryFormat(e)
UnexpectedInventoryFormat: not well-formed (invalid token): line 90, column 81

0.267 return code 3

Revision history for this message
Gavin Carr (gavin-openfusion) wrote :

FWIW, Martin asked me to see if I could replicate this on a 2a format branch, and the problem doesn't seem to appear there at all.

Revision history for this message
Martin Pool (mbp) wrote :

I think this is fixed in the 2a format, and not feasible to fix in earlier formats.

Changed in bzr:
status: New → Invalid
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.