Bug in dirstate _iter_changes

John Arbash Meinel john at arbash-meinel.com
Fri Apr 20 16:41:30 BST 2007


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

Aaron Bentley wrote:
> Hi all,
> 
> At work, I have encountered a bug in the dirstate version of
> iter_changes.  If I force it to use the generic form, iter_changes works
> fine.
> 
> It's proprietary data, and I have been unable to reduce it to a simple
> test case.
> 
> I also can't read dirstate's iter_changes implementation-- it's way, way
> too big.

completely agreed. We really need to change the loops. (Loop over
matching entries, then process them). As is, we have to have to many
special cases.

> 
> But iter_changes appears to sometimes recurse into unversioned
> directories, and if it doesn't have permission, it crashes.

Can you try it after my patch for:
http://bzr.arbash-meinel.com/branches/bzr/0.16-dev/iter_changes_unknowns_104257

This just merged into bzr.dev (2438).

What was happening was that a versioned (but empty) directory was not
being handled correctly.

One way to test it would be to do:

bzr init foo
cd foo
bzr mkdir empty
bzr mkdir full
touch full/a
touch full/b
bzr add
bzr commit -m "started"

mkdir -p empty/intermediate/notmine
chmod 0000 empty/intermediate/notmine
bzr status


That gives me:

bzr: ERROR: [Errno 13] Permission denied:
'.../foo//empty/intermediate/notmine'

But with my update it gives me:
unknown:
  empty/intermediate/

So this may now be fixed.


John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGKN8qJdeBCYSNAAMRAtBRAJ9bUAm56Wl0iiLxJoC3BJ6mv9VLkgCgm5e2
Au8YW2NBgUeOLZ2y4PaQXSQ=
=sYLV
-----END PGP SIGNATURE-----



More information about the bazaar mailing list