Comment 16 for bug 1031679

Revision history for this message
Oliver (oliver-assarbad) wrote :

Using pydb, I am stepping through the code and ended up breaking here (.pydbrc contents):

b /home/oliver/.local/lib/python2.7/site-packages/fastimport/commands.py:348
condition 1 path == 'ssl/certs/3b2716e5.0'
continue

This way I break exactly when the condition occurs, although it's somewhat sluggish.

The line I am breaking on is:

348 return "M %s %s %s%s" % (self._format_mode(self.mode), dataref, path, datastr)

I am using the latest development code from launchpad for both bzr-fastimport and python-fastimport.

(Pydb) p datastr
u'\ndata 47\nEBG_Elektronik_...flay\u0131c\u0131s\u0131.pem'

Still a "wide" Unicode string (yeah, I know UTF-8 is also an encoding of Unicode). So I dug a bit further and Jelmer was perfectly right. The solution is pass the path encoded already.

The patch is trivial, I am attaching it.

A test run on the etckeeper repo that has given me the headaches gives:

[2] oliver@yggdrasil:~/bug-1031679$ git init etckeeper-gitconv
Initialized empty Git repository in /home/oliver/bug-1031679/etckeeper-gitconv/.git/
[2] oliver@yggdrasil:~/bug-1031679$ (cd etckeeper-gitconv/ && bzr fast-export --plain ~/etc | git fast-import)
01:49:16 Calculating the revisions to include ...
01:49:16 Starting export of 16 revisions ...
01:49:16 Exported 16 revisions in 0:00:01
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1872 ( 331 duplicates )
      blobs : 1657 ( 320 duplicates 577 deltas of 1521 attempts)
      trees : 199 ( 11 duplicates 34 deltas of 198 attempts)
      commits: 16 ( 0 duplicates 0 deltas of 0 attempts)
      tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
      marks: 1024 ( 16 unique )
      atoms: 1812
Memory total: 2469 KiB
       pools: 2235 KiB
     objects: 234 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 8589934592
pack_report: pack_used_ctr = 60
pack_report: pack_mmap_calls = 31
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 1293621 / 1293621
---------------------------------------------------------------------