bzr diff crashes with "unsupported operand type" with working tree format 4

Bug #108255 reported by Martin Pitt
2
Affects Status Importance Assigned to Milestone
Bazaar
New
Undecided
Unassigned

Bug Description

After upgrading my postgresql bzr trees to the latest working tree format I noticed that bzr diff died with an exception when I renamed the top level directory.

Simple reproducer:

$ mkdir /tmp/x
$ cd /tmp/x
$ mkdir foo
$ echo hi> foo/hello.txt
$ bzr add .
$ bzr commit -m 'initial release'
added foo
added foo/hello.txt
Committed revision 1.
$ bzr mv foo bar
foo => bar
$ echo workd > bar/hello.txt
$ bzr diff
bzr: ERROR: exceptions.TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 650, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 612, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 304, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 622, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 1438, in run
    old_label=old_label, new_label=new_label)
  File "/usr/lib/python2.5/site-packages/bzrlib/diff.py", line 375, in diff_cmd_helper
    extra_trees=extra_trees)
  File "/usr/lib/python2.5/site-packages/bzrlib/diff.py", line 403, in show_diff_trees
    extra_trees=extra_trees)
  File "/usr/lib/python2.5/site-packages/bzrlib/diff.py", line 475, in _show_diff_trees
    _patch_header_date(old_tree, file_id, path))
  File "/usr/lib/python2.5/site-packages/bzrlib/diff.py", line 488, in _patch_header_date
    return timestamp.format_patch_date(tree.get_file_mtime(file_id, path))
  File "/usr/lib/python2.5/site-packages/bzrlib/timestamp.py", line 131, in format_patch_date
    tm = time.gmtime(secs+offset)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

bzr 0.15.0 on python 2.5.1.candidate.1 (linux2)
arguments: ['/usr/bin/bzr', 'diff']

If I use .bzr.backup with working tree format 3 this works as expected.

Revision history for this message
Alexander Belchenko (bialix) wrote :

This is duplicate of #103870. This bug already fixed and bugfix available in bzr.dev and in next release.

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.