PathNotChild traceback from 'bzr add branch1/a branch2/b'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Martin Pool |
Bug Description
I don't believe we plan to support adding files to multiple branches at the same time, but we also shouldn't give an ugly traceback.
Specifically, if you do:
bzr init branch1
bzr init branch2
touch branch1/a
touch branch2/a
bzr add branch1 branch2
You get a traceback with:
bzr: ERROR: bzrlib.
Traceback (most recent call last):
File "/Users/
return run_bzr(argv)
File "/Users/
ret = run(*run_argv)
File "/Users/
return self.run(
File "/Users/
action=action, save=not dry_run)
File "/Users/
return smart_add_
File "/Users/
action=action, save=save)
File "/Users/
rf = FastPath(
File "/Users/
return osutils.
File "/Users/
raise errors.
PathNotChild: Path u'/Users/
bzr 0.16.0dev0 on python 2.4.1.final.0 (darwin)
arguments: ['/Users/
** please send this report to <email address hidden>
Which is one of those "correct but useless" errors.
We could do a try/except PathNotChild around smart_add_tree in cmd_add.
Or we could use 'tree_files' which would give us "FileInWrongBra
The first problem is that it won't work with the current smart_add_tree api when you are in a subdirectory.
Because 'smart_add_tree' calls tree.relpath() which would have already been called by 'tree_files'.
On the flip side, we are currently calling "smart_add()" which does the basics of 'tree_files' including _prepare_file_list, which is then called *again* in smart_add_tree.
Using 'tree_files' gives this error:
$ bzr add branch1 branch2
bzr: ERROR: branch2 is not in the same branch as branch1
Which is at least a lot better than the traceback.
Related branches
- bzr-core: Pending requested
-
Diff: 131 lines (+33/-20)5 files modifiedNEWS (+7/-0)
bzrlib/builtins.py (+6/-13)
bzrlib/diff.py (+3/-6)
bzrlib/errors.py (+3/-1)
bzrlib/tests/blackbox/test_add.py (+14/-0)
Changed in bzr: | |
status: | New → Confirmed |
Changed in bzr: | |
importance: | Undecided → Medium |
summary: |
- 'bzr add branch1 branch2' gives a traceback + PathNotChild traceback from 'bzr add branch1/a branch2/b' |
tags: | added: add traceback |
Changed in bzr: | |
status: | Confirmed → In Progress |
assignee: | nobody → Martin Pool (mbp) |
Changed in bzr: | |
status: | In Progress → Fix Released |