bzr.dev dirstate can't revert/remove-tree after removed merge conflict

Bug #118186 reported by Matthew Fuller
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Aaron Bentley

Bug Description

This bug does NOT occur with 0.16, knit or dirstate.
This does not occur on bzr.dev with knit.
This DOES occur with bzr.dir with dirstate.

#!/bin/sh -x
bzr="/usr/local/bin/bzr"

# Create initial branch
#${bzr} init --format=knit A
${bzr} init A
(
    cd A ;
    mkdir a ;
    touch a/b ;
    ${bzr} add ;
    ${bzr} ci -m 'add A'
)

# Branch it and create a new a/ and a/b
${bzr} branch A B
(
    cd B ;
    ${bzr} rm --force a ;
    mkdir a ;
    touch a/b ;
    ${bzr} add ;
    ${bzr} ci -m 'redo in B'
)

# Change stuff in A
(
    cd A ;
    echo 'changes' > a/b ;
    ${bzr} ci -m 'change A'
)

# Merge the changes. Remove the re-added copy of A's a/b.OTHER, and try
# to revert or remove-tree.
(
    cd B ;
    ${bzr} merge ;
    rm a/b.OTHER ;
    ${bzr} revert ; # Fails
    ${bzr} remove-tree # Fails
)

# 'bzr resolve'ing the conflict doesn't help; revert and rm-tree still fail

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 118186] bzr.dev dirstate can't revert/remove-tree after removed merge conflict
Download full text (4.1 KiB)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

fullermd wrote:
> This bug does NOT occur with 0.16, knit or dirstate.
> This does not occur on bzr.dev with knit.
> This DOES occur with bzr.dir with dirstate.

My tests show that this bug was introduced in revno 2499:
(John Arbash Meinel, r=robert) Tweak _iter_changes and update_entry to
make bzr status and bzr diff much faster

Here are the relevant tracebacks:

bzr: ERROR: exceptions.OSError: [Errno 2] No such file or directory:
'/home/abentley/foo/B/a/b.OTHER'

Traceback (most recent call last):
  File "/home/abentley/bzr/bzr.dev/bzrlib/commands.py", line 718, in
run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/abentley/bzr/bzr.dev/bzrlib/commands.py", line 679, in run_bzr
    ret = run(*run_argv)
  File "/home/abentley/bzr/bzr.dev/bzrlib/commands.py", line 375, in
run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/abentley/bzr/bzr.dev/bzrlib/builtins.py", line 2903, in run
    not no_backup, pb, report_changes=True)
  File "/home/abentley/bzr/bzr.dev/bzrlib/mutabletree.py", line 38, in
tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/home/abentley/bzr/bzr.dev/bzrlib/workingtree.py", line 1864, in
revert
    report_changes)
  File "/home/abentley/bzr/bzr.dev/bzrlib/transform.py", line 1424, in
revert
    filenames, backups)
  File "/home/abentley/bzr/bzr.dev/bzrlib/transform.py", line 1452, in
_alter_files
    merge_modified = working_tree.merge_modified()
  File "/home/abentley/bzr/bzr.dev/bzrlib/decorators.py", line 127, in
read_locked
    return unbound(self, *args, **kwargs)
  File "/home/abentley/bzr/bzr.dev/bzrlib/workingtree.py", line 864, in
merge_modified
    if text_hash == self.get_file_sha1(file_id):
  File "/home/abentley/bzr/bzr.dev/bzrlib/workingtree_4.py", line 417,
in get_file_sha1
    stat_value = os.lstat(file_abspath)
OSError: [Errno 2] No such file or directory:
'/home/abentley/foo/B/a/b.OTHER'

bzr 0.17.0dev0 on python 2.4.1.final.0 (linux2)
arguments: ['/home/abentley/bin/bzr', '-Derror', 'revert']

** please send this report to <email address hidden>
+ /home/abentley/bin/bzr -Derror remove-tree
bzr: ERROR: exceptions.OSError: [Errno 2] No such file or directory:
'/home/abentley/foo/B/a/b.OTHER'

Traceback (most recent call last):
  File "/home/abentley/bzr/bzr.dev/bzrlib/commands.py", line 718, in
run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/abentley/bzr/bzr.dev/bzrlib/commands.py", line 679, in run_bzr
    ret = run(*run_argv)
  File "/home/abentley/bzr/bzr.dev/bzrlib/commands.py", line 375, in
run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/abentley/bzr/bzr.dev/bzrlib/builtins.py", line 273, in run
    d.destroy_workingtree()
  File "/home/abentley/bzr/bzr.dev/bzrlib/bzrdir.py", line 1075, in
destroy_workingtree
    wt.revert([], old_tree=empty)
  File "/home/abentley/bzr/bzr.dev/bzrlib/mutabletree.py", line 38, in
tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/home/abentley/bzr/bzr.dev/bzrlib/workingtree.py", line 1864, in
revert
    report_changes)
  File "/home/abentley/bzr/bzr.dev/bzrlib/transform.py", line 1424, in
revert
    filenames, backups)
  File "/home...

Read more...

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

This went out in 0.17.

Changed in bzr:
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.