mv --auto does not handle directory adds mixed with the contents of a directory splitting in two: InconsistentDelta error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Bazaar |
High
|
mnn | ||
| Breezy |
Medium
|
Jelmer Vernooij |
Bug Description
#!/bin/bash
rm -rf testrepo
bzr init testrepo
cd testrepo
mkdir a
echo 1 > a/file1.java
echo 2 > a/file2.java
echo 3 > a/file3.java
bzr add
bzr commit -m "Initial commit"
mkdir c
mv a/file1.java c/file1new.java
mv a/file2.java a/file2new.java
mv a/file3.java a/file3new.java
echo "-------- moving ---------------"
bzr mv --auto
...
a => c
a/file1.java => c/file1new.java
a/file2.java => a/file2new.java
a/file3.java => a/file3new.java
bzr: ERROR: An inconsistent delta was supplied involving u'a', 'a-id-1'
reason: This parent is not present.
Related branches
- Martin Packman (community): Approve on 2012-07-30
- bzr-core: Pending requested 2012-07-30
-
Diff: 51 lines (+25/-1)2 files modifiedbzrlib/rename_map.py (+8/-1)
bzrlib/tests/test_rename_map.py (+17/-0)
- Martin Packman: Approve on 2017-11-11
-
Diff: 3847 lines (+708/-763)48 files modifiedbreezy/rename_map.py (+8/-1)
breezy/tests/test_groupcompress.py (+271/-292)
breezy/tests/test_rename_map.py (+15/-0)
doc/developers/HACKING.txt (+63/-109)
doc/developers/branding.txt (+14/-0)
doc/developers/bug-handling.txt (+38/-39)
doc/developers/case-insensitive-file-systems.txt (+1/-1)
doc/developers/check.txt (+1/-1)
doc/developers/code-review.txt (+7/-7)
doc/developers/code-style.txt (+17/-17)
doc/developers/colocated-branches.txt (+26/-26)
doc/developers/config-rationale.txt (+7/-7)
doc/developers/content-filtering.txt (+3/-3)
doc/developers/contribution-quickstart.txt (+2/-2)
doc/developers/cycle.txt (+9/-10)
doc/developers/development-repo.txt (+7/-7)
doc/developers/documenting-changes.txt (+4/-4)
doc/developers/ec2.txt (+4/-4)
doc/developers/implementation-notes.txt (+1/-1)
doc/developers/index-plain.txt (+22/-25)
doc/developers/index.txt (+6/-7)
doc/developers/indices.txt (+3/-3)
doc/developers/integration.txt (+25/-25)
doc/developers/inventory.txt (+6/-6)
doc/developers/last-modified.txt (+1/-1)
doc/developers/lca_tree_merging.txt (+1/-1)
doc/developers/network-protocol.txt (+1/-1)
doc/developers/overview.txt (+12/-12)
doc/developers/packrepo.txt (+3/-3)
doc/developers/plans/index.txt (+0/-2)
doc/developers/plans/performance/commit.txt (+5/-5)
doc/developers/plans/performance/directory-fingerprints.txt (+1/-1)
doc/developers/plans/performance/incremental-push-pull.txt (+1/-1)
doc/developers/plans/performance/roadmap.txt (+1/-1)
doc/developers/plugin-api.txt (+46/-46)
doc/developers/ppa.txt (+6/-6)
doc/developers/principles.txt (+9/-9)
doc/developers/profiling.txt (+4/-4)
doc/developers/releasing.txt (+13/-13)
doc/developers/repository-stream.txt (+1/-1)
doc/developers/repository.txt (+3/-3)
doc/developers/revision-properties.txt (+2/-2)
doc/developers/specifications.txt (+7/-2)
doc/developers/transports.txt (+12/-12)
doc/developers/ui.txt (+15/-15)
doc/developers/win32_build_setup.txt (+1/-1)
doc/developers/xdg_config_spec.txt (+0/-24)
doc/en/release-notes/brz-3.0.txt (+3/-0)
Martin Pool (mbp) wrote : Re: dirstate AssertionError: "Could not find target parent in wt" after auto mv/rename | #1 |
summary: |
- AssertionError: Could not find target parent in wt + dirstate AssertionError: "Could not find target parent in wt" after + auto mv/rename |
Changed in bzr: | |
importance: | Undecided → High |
status: | New → Confirmed |
summary: |
dirstate AssertionError: "Could not find target parent in wt" after - auto mv/rename + auto mv/rename or deleting directory |
Martin Pool (mbp) wrote : | #2 |
In bug 277476 this occurred after deleting a directory
tags: | added: dirstate |
Robert Collins (lifeless) wrote : Re: dirstate AssertionError: "Could not find target parent in wt" after auto mv/rename or deleting directory | #3 |
Fritz, could you try to duplicate this with current bzr.dev ? Its quite complex to reproduce exactly without sample data, so I'd like it if:
- you can confirm that its still not fixed
- you could create a small script that demonstrates the problem.
something like:
bzr init trunk
cd trunk
echo 1 > 1
echo 2 > 2
#...
bzr add
bzr commit -m "1"
# make the changes you need to setup the failure you're getting
bzr mv --auto
Robert Collins (lifeless) wrote : | #4 |
Ping? Fritz, can you please try as I asked...
Changed in bzr: | |
status: | Confirmed → Incomplete |
Frits Jalvingh (fjalvingh) wrote : | #5 |
Oops... I missed your request, sorry.
I am able to reproduce in our full tree, I will try to make a script for you.
The base cause seems very clear though in the topmost trace, the bzr mv --auto **renames**:
vp-soap-
but the source dir (vp-soap-
I made a new testcase and tried it with bzr-1.17:
jal@odeon:
removed:
vp-soap-
vp-soap-
vp-soap-
vp-soap-
vp-soap-
vp-soap-
vp-soap-
unknown:
vp-soap-
vp-soap-
vp-soap-
vp-soap-
vp-soap-
jal@odeon:
jal@odeon:
vp-soap-
vp-soap-
vp-soap-
vp-soap-
vp-soap-
jal@odeon:
bzr: ERROR: exceptions.
parent of: (('vp-soap-
Traceback (most recent call last):
File "/usr/lib/
return the_callable(*args, **kwargs)
File "/usr/lib/
ret = run(*run_argv)
File "/usr/lib/
return self.run(
File "/usr/lib/
result = func(*args, **kwargs)
File "/usr/lib/
show_
File "/usr/lib/
want_
Robert Collins (lifeless) wrote : Re: [Bug 373319] Re: dirstate AssertionError: "Could not find target parent in wt" after auto mv/rename or deleting directory | #6 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Frits Jalvingh wrote:
> Oops... I missed your request, sorry.
Thats fine.
erver/TestJaxb.java =>
vp-soap-
> vp-soap-
> bzr: ERROR: An inconsistent delta was supplied involving u'vp-soap-
> reason: This parent is not present.
>
> Different error, same problem.
>
> I will try to make a script for this but need to find some time to do
> so.
That would be great. It looks slightly different to a [similar] bug with
mv --auto and unversioned directories.
bzr 1.18 will no longer corrupt your dirstate, so you won't get ongoing
errors after this happens, only at the specific command that fails.
- -Rob
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkq
L0YAnj2shw3dBva
=ZmrL
-----END PGP SIGNATURE-----
Frits Jalvingh (fjalvingh) wrote : Re: dirstate AssertionError: "Could not find target parent in wt" after auto mv/rename or deleting directory | #7 |
This script shows the observed problem. Key points:
* From an original directory move some files to a new directory
* Cause a RENAME change in the original source directory too (it must be a rename change)
The root cause is that mv --auto almost always sees the moving of a few files to a new directory as a rename of the directory - and that is only the case in a very limited number of circumstances:
* If the source directory is empty or gone (certainty)
* if the number of files moved to the new dir is bigger than the remaining number in the source one might say the directory moved (and some files were then moved back).
You can see this wrong behaviour also if you just move a few files from the original to the new without renaming stuff in the source dir: bzr will not die but it will mark the source as renamed to new, and it will have an "unknown" (= not added) status for the remaining source - which is very wrong also (the files that are still left in it were version controlled).
Execution of the above script:
jal@cluny:~/j$ ./tbzr
2.0dev
Created a standalone tree (format: 2a)
adding a
adding a/file1.java
adding a/file2.java
adding a/file3.java
adding a/file4.java
adding a/file5.java
Committing to: /home/jal/
added a
added a/file1.java
added a/file2.java
added a/file3.java
added a/file4.java
added a/file5.java
Missing checkcommit.jar, not checking commits.
Committed revision 1.
removed:
a/file1.java
a/file2.java
a/file3.java
modified:
a/file4.java
unknown:
c/
a/file3new.java
a/file4new.java
-------- moving ---------------
a => c
a/file1.java => c/file1new.java
a/file2.java => c/file2new.java
a/file3.java => a/file3new.java
bzr: ERROR: An inconsistent delta was supplied involving u'a', 'a-200908220928
reason: This parent is not present.
-------- status ---------------
removed:
a/file1.java
a/file2.java
a/file3.java
modified:
a/file4.java
unknown:
c/
a/file3new.java
a/file4new.java
Changed in bzr: | |
status: | Incomplete → Confirmed |
Robert Collins (lifeless) wrote : | #8 |
smaller reproduction script. Seems to rename c, and then operate on a.
#!/bin/bash
rm -rf testrepo
bzr init testrepo
cd testrepo
mkdir a
echo 1 > a/file1.java
echo 2 > a/file2.java
echo 3 > a/file3.java
bzr add
bzr commit -m "Initial commit"
mkdir c
mv a/file1.java c/file1new.java
mv a/file2.java a/file2new.java
mv a/file3.java a/file3new.java
echo "-------- moving ---------------"
bzr mv --auto
summary: |
- dirstate AssertionError: "Could not find target parent in wt" after - auto mv/rename or deleting directory + mv --auto does not handle directory adds mixed with the contents of a + directory splitting in two: InconsistentDelta error |
tags: | removed: dirstate |
description: | updated |
Erik de Castro Lopo (erikd) wrote : | #9 |
I have a broken repo. Poolie suggested I branch from the broken repo to a new one when I got a new crash. He asked me to post the traceback.
Fabian Köster (maestro-alubia) wrote : | #10 |
I also ran into this after using 'bzr mv'.
Can we expect a new release with a fix soon? Please let me know if I can help!
tags: | added: case-sensitivity |
tags: | added: mv |
mnn (mnn282) wrote : | #11 |
I've been able to fix this - required a few changes in RenameMap.
Changed in bzr: | |
assignee: | nobody → mnn (mnn282) |
tags: | added: check-for-breezy |
Changed in brz: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in brz: | |
assignee: | nobody → Jelmer Vernooij (jelmer) |
status: | Triaged → In Progress |
Changed in brz: | |
status: | In Progress → Fix Released |
milestone: | none → 3.0.0 |
tags: | removed: check-for-breezy |
This is a similar traceback to and may represent a regression of bug 150438.