bzr fast-export-from-p4 fails with UnboundLocalError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar Fast Import |
Invalid
|
Low
|
Jelmer Vernooij |
Bug Description
Fast export from p4 ran silently for several seconds before failing. It produced a sizable but invalid .fi file (produced an unexpected EOF error when fed back into bzr fast-import). The error is entirely repeatable, and appears to occur right at the end of the export run. Exporting large amounts of data takes longer and produces a larger invalid file than when exporting smaller amounts.
This is on OS X 10.6.
Here's the output:
mbp:~ csosborn$ bzr fast-export-from-p4 //depot/web/main main.fi
bzr: ERROR: exceptions.
Traceback (most recent call last):
File "/Library/
return the_callable(*args, **kwargs)
File "/Library/
ret = run(*run_argv)
File "/Library/
return self.run(
File "/Library/
return self._operation
File "/Library/
self.cleanups, self.func, *args, **kwargs)
File "/Library/
result = func(*args, **kwargs)
File "/Library/
fast_
File "/Library/
custom=custom)
File "/Library/
self.
UnboundLocalError: local variable 'retcode' referenced before assignment
bzr 2.2.0 on python 2.6.1 (Darwin-
arguments: ['/usr/
encoding: 'UTF-8', fsenc: 'utf-8', lang: 'en_US.UTF-8'
plugins:
bash_completion /Library/
bzrp4 /Library/
bzrtools /Library/
colo /Library/
email /Library/
explorer /Library/
extmerge /Library/
fastimport /Library/
keychain /Library/
launchpad /Library/
loom /Library/
netrc_
news_merge /Library/
pipeline /Library/
qbzr /Library/
rewrite /Library/
svn /Library/
upload /Library/
xmloutput /Library/
*** Bazaar has encountered an internal error. This probably indicates a
bug in Bazaar. You can help us fix it by filing a bug report at
https:/
including this traceback and a description of the problem.
Related branches
- Martin Packman (community): Approve
-
Diff: 5423 lines (+20/-4960)68 files modifiedNEWS (+8/-0)
README.txt (+0/-4)
__init__.py (+1/-29)
cmds.py (+11/-234)
exporters/Makefile (+0/-15)
exporters/__init__.py (+0/-326)
exporters/darcs/.gitignore (+0/-3)
exporters/darcs/Makefile (+0/-55)
exporters/darcs/NEWS (+0/-26)
exporters/darcs/README (+0/-187)
exporters/darcs/TODO (+0/-8)
exporters/darcs/asciidoc.conf (+0/-21)
exporters/darcs/d2x (+0/-112)
exporters/darcs/d2x.txt (+0/-27)
exporters/darcs/darcs-fast-export (+0/-380)
exporters/darcs/darcs-fast-export.txt (+0/-68)
exporters/darcs/darcs-fast-import (+0/-375)
exporters/darcs/darcs-fast-import.txt (+0/-57)
exporters/darcs/git-darcs (+0/-279)
exporters/darcs/git-darcs.txt (+0/-92)
exporters/darcs/t/Makefile (+0/-9)
exporters/darcs/t/bench-results/Makefile (+0/-5)
exporters/darcs/t/bench-results/bench-results.gnu (+0/-6)
exporters/darcs/t/bench-results/bench-results.py (+0/-23)
exporters/darcs/t/bench-tailor.sh (+0/-59)
exporters/darcs/t/bench.sh (+0/-38)
exporters/darcs/t/lib-httpd.sh (+0/-67)
exporters/darcs/t/lib.sh (+0/-337)
exporters/darcs/t/test-bzr.sh (+0/-16)
exporters/darcs/t/test-git-d2x.sh (+0/-19)
exporters/darcs/t/test-git-incremental.sh (+0/-24)
exporters/darcs/t/test-git-progress.sh (+0/-18)
exporters/darcs/t/test-git.sh (+0/-18)
exporters/darcs/t/test-hg-d2x.sh (+0/-12)
exporters/darcs/t/test-hg.sh (+0/-16)
exporters/darcs/t/test2-bzr-d2x.sh (+0/-19)
exporters/darcs/t/test2-bzr-incremental.sh (+0/-21)
exporters/darcs/t/test2-git-funny-tagname.sh (+0/-25)
exporters/darcs/t/test2-git-http.sh (+0/-22)
exporters/darcs/t/test2-git-incremental-specworkdir.sh (+0/-22)
exporters/darcs/t/test2-git-incremental.sh (+0/-21)
exporters/darcs/t/test2-git.sh (+0/-18)
exporters/darcs/t/testimport-bzr-x2d.sh (+0/-15)
exporters/darcs/t/testimport-bzr.sh (+0/-15)
exporters/darcs/t/testimport-copy.sh (+0/-26)
exporters/darcs/t/testimport-darcs.sh (+0/-17)
exporters/darcs/t/testimport-deleteall.sh (+0/-31)
exporters/darcs/t/testimport-git-incremental.sh (+0/-16)
exporters/darcs/t/testimport-git-twoway-gd.sh (+0/-34)
exporters/darcs/t/testimport-git-twoway.sh (+0/-30)
exporters/darcs/t/testimport-git-x2d.sh (+0/-15)
exporters/darcs/t/testimport-git.sh (+0/-15)
exporters/darcs/t/testimport-gitsymlink.sh (+0/-45)
exporters/darcs/t/testimport-hg-x2d.sh (+0/-15)
exporters/darcs/t/testimport-hg.sh (+0/-15)
exporters/darcs/t/testimport-rename.sh (+0/-25)
exporters/darcs/x2d (+0/-125)
exporters/darcs/x2d.txt (+0/-28)
exporters/hg-fast-export.README (+0/-54)
exporters/hg-fast-export.py (+0/-442)
exporters/hg-fast-export.sh (+0/-100)
exporters/hg2git.py (+0/-112)
exporters/svn-archive.c (+0/-240)
exporters/svn-fast-export.README (+0/-12)
exporters/svn-fast-export.c (+0/-187)
exporters/svn-fast-export.py (+0/-225)
info.py (+0/-7)
setup.py (+0/-1)
affects: | bzr → bzr-fastimport |
Changed in bzr-fastimport: | |
assignee: | nobody → Jelmer Vernooij (jelmer) |
status: | Triaged → In Progress |
I looked a little closer and found that the invalid reference to "retcode" occurs in the finally portion of a try block, and that retcode is not set because an exception is thrown earlier. Initializing retcode and trying again reveals the actual error. Although the output claims that the export completed successfully, the resulting file is incomplete.
mbp:~ csosborn$ bzr fast-export-from-p4 //depot/web/main main.fi IndexError: list index out of range
Export to main.fi completed successfully.
bzr: ERROR: exceptions.
Traceback (most recent call last): Python/ 2.6/site- packages/ bzrlib/ commands. py", line 911, in exception_ to_return_ code Python/ 2.6/site- packages/ bzrlib/ commands. py", line 1111, in run_bzr Python/ 2.6/site- packages/ bzrlib/ commands. py", line 689, in run_argv_aliases **all_cmd_ args) Python/ 2.6/site- packages/ bzrlib/ commands. py", line 704, in run .run_simple( *args, **kwargs) Python/ 2.6/site- packages/ bzrlib/ cleanup. py", line 135, in run_simple Python/ 2.6/site- packages/ bzrlib/ cleanup. py", line 165, in _do_with_cleanups Python/ 2.6/site- packages/ bzrlib/ plugins/ fastimport/ __init_ _.py", line 903, in run export_ from(source, destination, 'p4', verbose, custom) Python/ 2.6/site- packages/ bzrlib/ plugins/ fastimport/ exporters/ __init_ _.py", line 328, in fast_export_from Python/ 2.6/site- packages/ bzrlib/ plugins/ fastimport/ exporters/ __init_ _.py", line 281, in generate export. main([source] ) Python/ 2.6/site- packages/ bzrlib/ plugins/ bzrp4/p4_ fast_export. py", line 10, in main main([' export' ] + args) Python/ 2.6/site- packages/ bzrlib/ plugins/ bzrp4/git_ p4.py", line 1899, in main Python/ 2.6/site- packages/ bzrlib/ plugins/ bzrp4/git_ p4.py", line 1740, in run Python/ 2.6/site- packages/ bzrlib/ plugins/ bzrp4/git_ p4.py", line 1534, in run importHeadRevis ion(revision) Python/ 2.6/site- packages/ bzrlib/ plugins/ bzrp4/git_ p4.py", line 1334, in importHeadRevision commit( details, self.extractFil esFromCommit( details) , self.branch, self.depotPaths) Python/ 2.6/site- packages/ bzrlib/ plugins/ bzrp4/git_ p4.py", line 937, in commit Python/ 2.6/site- packages/ bzrlib/ plugins/ bzrp4/git_ p4.py", line 1802, in get_data
File "/Library/
return the_callable(*args, **kwargs)
File "/Library/
ret = run(*run_argv)
File "/Library/
return self.run(
File "/Library/
return self._operation
File "/Library/
self.cleanups, self.func, *args, **kwargs)
File "/Library/
result = func(*args, **kwargs)
File "/Library/
fast_
File "/Library/
custom=custom)
File "/Library/
retcode = p4_fast_
File "/Library/
return git_p4.
File "/Library/
if not cmd.run(args):
File "/Library/
if not P4Sync.run(self, depotPaths):
File "/Library/
self.
File "/Library/
self.
File "/Library/
data = file.get_data(p4)
File "/Library/
stat = filedata[0]
IndexError: list index out of range
bzr 2.2.0 on python 2.6.1 (Darwin- 10.4.0- i386-64bit) local/bin/ bzr', 'fast-export- from-p4' , '//depot/ web/main/ sks/packages/ sitelier- sks', 'sks.fi'] Python/ 2.6/site- packages/ bzrlib/ plugins/ bash_completion [2.2.0] Python/ 2.6/site- packages/ bzrlib/ pl...
arguments: ['/usr/
encoding: 'UTF-8', fsenc: 'utf-8', lang: 'en_US.UTF-8'
plugins:
bash_completion /Library/
bzrp4 /Library/