does not strip \r from commit messages

Bug #402690 reported by Ricky
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
CVS to Bazaar importer
Triaged
Medium
Unassigned

Bug Description

I tried to import a cvs repository with the line:

bzr cvsps-import --cvsps-dump module.dump /home/rickyn/projects/bazaarTransformation/oldRepository build enough-polish-build-mother

I got the following error:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Read 1942 patchsets (string cache hits: 0, total: 4147)
Failed while processing: Patchset(68, HEAD, enough, 2004/06/18 21:12:35)
Processed 67 patches (67 new, 0 existing) on 3 branches (1 tags) in 23.7s (2.83 patch/s)
bzr: ERROR: exceptions.ValueError: Invalid value for commit message: u'User defined JAD- and MANIFEST-attributes are now fully integrated (but not tested yet).\rUsing a lock-file for detecting failed runs of J2ME Polish.\n'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 835, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 1030, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 647, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/rickyn/.bazaar/plugins/cvsps_import/__init__.py", line 95, in run
    importer.process()
  File "/home/rickyn/.bazaar/plugins/cvsps_import/cvsps/importer.py", line 1275, in process
    self._process_patchsets(cvs_to_bzr, patchsets, pb=pb)
  File "/home/rickyn/.bazaar/plugins/cvsps_import/cvsps/importer.py", line 1214, in _process_patchsets
    rev_id, action = cvs_to_bzr.handle_patchset(patchset)
  File "/home/rickyn/.bazaar/plugins/cvsps_import/cvsps/importer.py", line 755, in handle_patchset
    revision_id = self._extract_changes(patchset)
  File "/home/rickyn/.bazaar/plugins/cvsps_import/cvsps/importer.py", line 1014, in _extract_changes
    revision_id=cvs_revision_id,
  File "/home/rickyn/.bazaar/plugins/cvsps_import/cvsps/importer.py", line 470, in commit
    new_revision_id = builder.commit(message)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 162, in commit
    self._validate_unicode_text(message, 'commit message')
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 145, in _validate_unicode_text
    raise ValueError('Invalid value for %s: %r' % (context, text))
ValueError: Invalid value for commit message: u'User defined JAD- and MANIFEST-attributes are now fully integrated (but not tested yet).\rUsing a lock-file for detecting failed runs of J2ME Polish.\n'

bzr 1.17 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'cvsps-import', '--cvsps-dump', 'module.dump', '/home/rickyn/projects/bazaarTransformation/oldRepository', 'build', 'enough-polish-build-mother']
encoding: 'ISO-8859-15', fsenc: 'ISO-8859-15', lang: 'en_US.ISO-8859-15'
plugins:
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.17]
  cvsps_import /home/rickyn/.bazaar/plugins/cvsps_import [unknown]
  gtk /usr/lib/python2.5/site-packages/bzrlib/plugins/gtk [0.95.0.final.1]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [1.17]
  netrc_credential_store /usr/lib/python2.5/site-packages/bzrlib/plugins/netrc_credential_store [1.17]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I am on Ubuntu 8.04 with the backport of bzr installed.
ii bzr 1.17-1~bazaar1~hardy1
ii bzr-gtk 0.95.0-1~bazaar1~hardy1
ii bzrtools 1.17.0-1~bazaar1~hardy1
ii cvsps 2.1-4

FIX:
The problem can be fixed by replacing the character '0x0d' with '0x0a'. The author of this log message is a mac user. I am happy to tell him that his mac is trouble :)

Ricky (immortalrick)
description: updated
Revision history for this message
Anye Li (li-anye-0) wrote :

This patch converts all \r\n and \r sequences in the logs to \n, which should cure the invalid commit message errors.

Jelmer Vernooij (jelmer)
Changed in bzr-cvsps-import:
status: New → Confirmed
summary: - ValueError: Invalid value for commit message
+ does not strip \r from commit messages
Changed in bzr-cvsps-import:
importance: Undecided → Medium
status: Confirmed → Triaged
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.