Smart add misses dir contents if dir was added as a different file type initally

Bug #921484 reported by Artur Rataj
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Low
Unassigned

Bug Description

When doing `bzr add` either with no arguments or on a directory, if a directory was previously added when it was a different kind of file, the contents will not be added:

$ bzr init branch
Created a standalone tree (format: 2a)
$ cd branch
$ touch d
$ bzr add
adding d
$ bzr add
$ rm d
$ mkdir d
$ touch d/f
$ bzr add
$ bzr st
added:
  d/
unknown:
  d/f
$ bzr add
$ bzr commit -m"Just add d"
Committing to: /tmp/branch/
added d
Committed revision 1.
$ bzr add
adding d/f

Using `bzr rm` or adding the contents by passing them explicitly as parameters does work.

Revision history for this message
Artur Rataj (arturrataj) wrote :

After I upgraded to 2.5beta, bzr commit added the directory but not the files in it, but this time no exception was reported.
But, I supposed bazaar confused the already non--existing link with the directory, because both had the same name, and the files in the directory were not added. Thus, I moved the directory somewhere else, made a commit, then I moved the directory back to the branch, add, commit, and this time all files in the directory were added as well.

Revision history for this message
Martin Packman (gz) wrote :

So, to summarise, the original error has been fixed in the latest bzr version, but you still think bzr is doing something wrong? Can you give the exact commands you're using, because it sounds like bzr is doing the right thing now. Unless you add the directory contents, they'll remain unversioned.

Changed in bzr:
status: New → Incomplete
Revision history for this message
Artur Rataj (arturrataj) wrote :

version 2.5beta:

1. create a symlink.
2. bzr add
3. remove the symlink, add a directory with files, and of the name of the symlink
5. bzr add

the files in the directory are reported as not added, just because the directory happens to have the same name as the former symlink.

have no idea if this is a bug or a feature.

Revision history for this message
Artur Rataj (arturrataj) wrote :

or rather, "are not reported as added"

Revision history for this message
Martin Packman (gz) wrote :

Thanks for the extra details Artur, I've updated the bug to reflect the fact this isn't related to symlinks.

description: updated
tags: added: add
summary: - bzr: ERROR: exceptions.AttributeError: 'InventoryLink' object has no
- attribute 'children'
+ Smart add misses dir contents if dir was added as a different file type
+ initally
Changed in bzr:
importance: Undecided → Low
status: Incomplete → Confirmed
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
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.