revert fails with "TypeError: 'in <string>' requires string as left operand"

Bug #88842 reported by Andrew Bennetts
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Aaron Bentley

Bug Description

First, the traceback:

$ ~/code/bzr/bzr revert
Subversion version too old for working tree support.
bzr: ERROR: exceptions.TypeError: 'in <string>' requires string as left operand

Traceback (most recent call last):
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 650, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 612, in run_bzr
    ret = run(*run_argv)
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 304, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/andrew/code/bzr/bzrlib/builtins.py", line 2672, in run
    not no_backup, pb, report_changes=True)
  File "/home/andrew/code/bzr/bzrlib/mutabletree.py", line 37, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/workingtree.py", line 1699, in revert
    report_changes)
  File "/home/andrew/code/bzr/bzrlib/transform.py", line 1360, in revert
    delta.report_changes(tt._iter_changes(), change_reporter)
  File "/home/andrew/code/bzr/bzrlib/transform.py", line 1026, in _iter_changes
    elif to_kind in ('file' or 'symlink') and (
TypeError: 'in <string>' requires string as left operand

bzr 0.15.0dev0 on python 2.4.4.candidate.1 (linux2)
arguments: ['/home/andrew/code/bzr/bzr', 'revert']

** please send this report to <email address hidden>

I caused this by doing a "merge --uncommitted" from a working tree with uncommitted changes to a file that doesn't exist in tree I'm merging into.

Here's the commands I used to reproduce this situation:

$ cd /tmp/
andrew@steerpike:/tmp$ ~/code/bzr/bzr init b1
andrew@steerpike:/tmp$ cd b1
andrew@steerpike:/tmp/b1$ echo "one" > file.txt
andrew@steerpike:/tmp/b1$ ~/code/bzr/bzr add
added file.txt
andrew@steerpike:/tmp/b1$ ~/code/bzr/bzr ci -m "b1 initial commit"
added file.txt
Committed revision 1.
andrew@steerpike:/tmp/b1$ cd ..
andrew@steerpike:/tmp$ ~/code/bzr/bzr branch b1 b2
Branched 1 revision(s).
andrew@steerpike:/tmp$ cd b1
andrew@steerpike:/tmp/b1$ echo "two" > file2.txt
andrew@steerpike:/tmp/b1$ ~/code/bzr/bzr add
added file2.txt
andrew@steerpike:/tmp/b1$ ~/code/bzr/bzr ci -m "b1 add file2"
added file2.txt
Committed revision 2.
andrew@steerpike:/tmp/b1$ echo "two edited" > file2.txt
andrew@steerpike:/tmp/b1$ cd ../b2
(reverse-i-search)`':
andrew@steerpike:/tmp/b2$ ~/code/bzr/bzr merge --uncommitted ../b1
+N file2.txt.OTHER
Contents conflict in file2.txt
1 conflicts encountered.
andrew@steerpike:/tmp/b2$ rm file2.txt.*
andrew@steerpike:/tmp/b2$ ~/code/bzr/bzr revert
(at this point the above traceback occurs)

Aaron Bentley (abentley)
Changed in bzr:
assignee: nobody → aaron-bentley
status: Unconfirmed → Fix Committed
Revision history for this message
John A Meinel (jameinel) wrote :

This was merged into bzr.dev as of revno 2344.

Changed in bzr:
importance: Undecided → High
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.