obvious bug in smart_add

John Arbash Meinel john at arbash-meinel.com
Sun Jul 2 06:22:27 BST 2006


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

I'm not sure what the correct fix is, but I'm fairly positive this is a bug.

In smart_add, after validating the user's input, we then iterate over
the list of directories, so that we can figure out what to add.

The second loop does this:
prev_dir = None
for path in sorted(user_dirs):
    if (prev_dir is None or not
        bzrlib.osutils.is_inside_or_parent_of_any([prev_dir], path)):
        dirs_to_add.append((rf, None))
    prev_dir = path


The problem is the 'dirs_to_add.append((rf, None))', that looks like it
is the local variable in the previous loop, not the best variable in
this loop.
I think it should be
dirs_to_add.append((path, None))

but I don't know the new smart_add code all that well.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEp1gTJdeBCYSNAAMRAsbkAJ4rfQLV1F2/cDKGY2QpqBEmAjPokACdGn0k
eS4TXa+h3hJ4dJA31qY32zk=
=4QTQ
-----END PGP SIGNATURE-----




More information about the bazaar mailing list