bzr add insists all files are in the same versioned tree

Bug #279442 reported by pookleblinky
2
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

pooklekufr@localhost ~/bin $ bzr version
Bazaar (bzr) 1.5
  Python interpreter: /usr/bin/python 2.5.1
  Python standard library: /usr/lib/python2.5

Here is the trace:

pooklekufr@localhost ~/bin $ bzr add C/* lisp/* php/* python/* ruby/* yoss/*
bzr: ERROR: bzrlib.errors.PathNotChild: Path "/home/pooklekufr/bin/lisp/bugs.txt" is not a child of path "/home/pooklekufr/bin/C"

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 846, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 373, in run
    no_recurse, action=action, save=not dry_run)
  File "/usr/lib/python2.5/site-packages/bzrlib/mutabletree.py", line 52, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/mutabletree.py", line 316, in smart_add
    rf = _FastPath(self.relpath(filepath))
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree.py", line 416, in relpath
    return osutils.relpath(self.basedir, path)
  File "/usr/lib/python2.5/site-packages/bzrlib/osutils.py", line 884, in relpath
    raise errors.PathNotChild(rp, base)
PathNotChild: Path "/home/pooklekufr/bin/lisp/bugs.txt" is not a child of path "/home/pooklekufr/bin/C"

bzr 1.5 on python 2.5.1 (linux2)
arguments: ['/usr/bin/bzr', 'add', 'C/bugs.txt', 'C/notes.txt', 'lisp/bugs.txt', 'lisp/fib-e.lisp', 'lisp/fibonacci.lisp', 'lisp/hello.lisp', 'lisp/notes.txt', 'php/bugs.txt', 'php/notes.txt', 'php/phpscratch.php', 'python/bugs.txt', 'python/fib-array.py', 'python/miller-rabin.py', 'python/naivemarkov.py', 'python/notes.txt', 'python/pointawards.py', 'python/pychallenge', 'ruby/blimmlimp', 'ruby/bugs.txt', 'ruby/fib-array.rb', 'ruby/fizzbuzz.rb', 'ruby/fizzgolf.rb', 'ruby/greet.rb', 'ruby/hello.rb', 'ruby/hemingway.rb', 'ruby/hpricot.test.rb', 'ruby/minirb.rb', 'ruby/myarray.rb', 'ruby/notes.txt', 'ruby/pandora.yaml', 'ruby/pandora.yml', 'ruby/pascal.rb', 'ruby/pookbot', 'ruby/pooklib.rb', 'ruby/rubycbcode.rb', 'ruby/ruby cookbook', 'ruby/rubyscratch.rb', 'ruby/ruby.syntax.css', 'ruby/syntax.highlighter.rb', 'ruby/turing.rb', 'yoss/bugs.txt', 'yoss/notes.txt', 'yoss/yoss']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

Revision history for this message
Andrew Bennetts (spiv) wrote :

I'd guess that /home/pooklekufr/bin/C and /home/pooklekufr/bin/lisp are separate branches. If so, bzr is working as intended, although the error should be clearer. e.g. "Cannot add to multiple checkouts in a single invocation"? At a minimum this case shouldn't trigger a traceback.

Alternatively, "bzr add" could allow this, i.e. allow you to modify multiple working trees at once. That feels a bit risky to me, but perhaps it's reasonable.

Revision history for this message
Andrew Bennetts (spiv) wrote :

This is easy to reproduce:

bzr init aaa
bzr init bbb
touch aaa/a bbb/b
bzr add aaa/a bbb/b

Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Martin Pool (mbp) wrote :

We should at least give a clearer message

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.