'bzr add ..' gives confusing results: bzrlib.errors.PathNotChild: Path "/subdir" is not a child of path "/subdir/ranbzrhere"

Bug #542951 reported by Jure Sah
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

Ubuntu 8.04 LTS
Bazaar 2.1.0 from "deb http://ppa.launchpad.net/bzr/ppa/ubuntu hardy main"

When using "bzr add .*" in my project directory in an attempt to add all hidden files, Bazaar fails completely with:
bzr: ERROR: bzrlib.errors.PathNotChild: Path "/home/username/dev" is not a child of path "/home/username/dev/myproject"

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    attaching the crash file
        /home/username/.cache/crash/bzr-20100320201556-25650.crash
    and including a description of the problem.

    The crash file is plain text and you can inspect or edit it to remove
    private information.

(Apparently trying to add ".." to the repo. Bug? Feature? I would still like to add all my hidden files somehow.)

Revision history for this message
Jure Sah (dustwolfy) wrote :
Revision history for this message
Martin Pool (mbp) wrote :

Hi,

You're right, the shell will be asking bzr to add .. and we can't really do that.

If you want to add all your hidden files then 'bzr add .[a-z0]9]*' should do it. Or why not just plain 'bzr add' with no arguments, which will add all non-ignored files.

Changed in bzr:
status: New → Invalid
Revision history for this message
Adam Porter (alphapapa) wrote :

Shouldn't there be a default exclusion of '..'? Isn't this a case where it's obvious what the right thing to do is, and Bazaar should do the right thing?

I ran into exactly the same situation as the submitter, and I only figured it out after googling and finding this bug report. The error message is completely unhelpful, as well.

Since it's impossible to add '..', and no one would want to do that anyway, shouldn't Bazaar just ignore that and do what the user obviously wants?

Changed in bzr:
status: Invalid → New
Revision history for this message
Martin Pool (mbp) wrote :

You're right, the message is unclear. I think there's a more general thing complaining about PathNotChild. In 2.4 you at least do not get a traceback.

summary: - bzrlib.errors.PathNotChild: Path "/subdir" is not a child of path
- "/subdir/ranbzrhere"
+ 'bzr add ..' gives confusing results: bzrlib.errors.PathNotChild: Path
+ "/subdir" is not a child of path "/subdir/ranbzrhere"
Changed in bzr:
status: New → Confirmed
importance: Undecided → Medium
tags: added: add confusing-ui
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.