variable referenced before assignment; breaks fast-export

Bug #1939219 reported by Keith Hellman
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Breezy
Fix Released
Medium
Jelmer Vernooij

Bug Description

psnap$ brz fast-export --plain . | git fast-import
22:41:06 Calculating the revisions to include ...
22:41:06 Starting export of 645 revisions ...
brz: ERROR: UnboundLocalError: local variable 'path' referenced before assignment

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/breezy/commands.py", line 1017, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/breezy/commands.py", line 1206, in run_bzr
    ret = run(*run_argv)
  File "/usr/local/lib/python3.8/site-packages/breezy/commands.py", line 757, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/local/lib/python3.8/site-packages/breezy/commands.py", line 782, in run
    return class_run(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/breezy/plugins/fastimport/cmds.py", line 502, in run
    return exporter.run()
  File "/usr/local/lib/python3.8/site-packages/breezy/plugins/fastimport/exporter.py", line 268, in run
    self.emit_commits(interesting)
  File "/usr/local/lib/python3.8/site-packages/breezy/plugins/fastimport/exporter.py", line 257, in emit_commits
    self.emit_commit(revobj, self.ref, trees[parent], trees[revid])
  File "/usr/local/lib/python3.8/site-packages/breezy/plugins/fastimport/exporter.py", line 382, in emit_commit
    self.print_cmd(self._get_commit_command(ref, mark, revobj, file_cmds))
  File "/usr/local/lib/python3.8/site-packages/breezy/plugins/fastimport/exporter.py", line 313, in print_cmd
    self.outf.write(b"%s\n" % cmd)
  File "/usr/local/lib/python3.8/site-packages/fastimport/commands.py", line 185, in __bytes__
    return self.to_string(include_file_contents=True)
  File "/usr/local/lib/python3.8/site-packages/fastimport/commands.py", line 237, in to_string
    [b'\n' + bytes(c) for c in self.iter_files()])
  File "/usr/local/lib/python3.8/site-packages/fastimport/commands.py", line 237, in <listcomp>
    [b'\n' + bytes(c) for c in self.iter_files()])
  File "/usr/local/lib/python3.8/site-packages/breezy/plugins/fastimport/exporter.py", line 507, in _get_filecommands
    path, renamed, tree_new.get_revision_id())
UnboundLocalError: local variable 'path' referenced before assignment

Related branches

Revision history for this message
Keith Hellman (khellman) wrote :

Same issue exists with lp:brz-3.2.1 branch.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Confirmed - this is probably due to the migration to TreeChange objects.

Changed in brz:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Jelmer Vernooij (jelmer)
Revision history for this message
Morten Kjeldgaard (mok0) wrote :

I experience the same error, with Python 3.9.

Jelmer Vernooij (jelmer)
Changed in brz:
status: Triaged → Fix Committed
milestone: none → 3.2.1
Jelmer Vernooij (jelmer)
Changed in brz:
status: Fix Committed → Fix Released
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.