bzr add <symlink> follows the link

Bug #183831 reported by tebeka
38
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Unassigned

Bug Description

mtebeka@bugs:.www - 10:09 $ ln -s ../work/bootcamp bootcamp
mtebeka@bugs:.www - 10:09 $ bzr add bootcamp
bzr: ERROR: bzrlib.errors.PathNotChild: Path "/home/mtebeka/.www/bootcamp" is not a child of path "/home/mtebeka/work/bootcamp"

Tags: symlink add

Related branches

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

Could this be a dupe of bug 124859?

Revision history for this message
Daniel Hahler (blueyed) wrote :
Download full text (3.5 KiB)

I think I've just ran into the same issue.

/home/user/www/hahler_de.bzr is the branch.
It contains the following symlink:
blogs/media -> /home/user/www/hahler_live/web/media

I don't know if it's a dupe of bug 124859, but sounds related from skimming comments.

Here's what I've done:

$ bzr merge --force
Merging from remembered location /home/user/dev/tailor/b2evo/bzr/
bzr: ERROR: bzrlib.errors.PathNotChild: Path "/home/user/www/hahler_live/web/media/t" is not a child of path "/home/user/www/hahler_de.bzr"

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 834, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 790, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 2895, in run
    verified)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 2913, in _do_merge
    conflict_count = merger.do_merge()
  File "/usr/lib/python2.5/site-packages/bzrlib/merge.py", line 421, in do_merge
    merge.do_merge()
  File "/usr/lib/python2.5/site-packages/bzrlib/merge.py", line 520, in do_merge
    self._compute_transform()
  File "/usr/lib/python2.5/site-packages/bzrlib/merge.py", line 570, in _compute_transform
    lambda t, c: conflict_pass(t, c, self.other_tree))
  File "/usr/lib/python2.5/site-packages/bzrlib/transform.py", line 1973, in resolve_conflicts
    conflicts = tt.find_conflicts()
  File "/usr/lib/python2.5/site-packages/bzrlib/transform.py", line 582, in find_conflicts
    self._add_tree_children()
  File "/usr/lib/python2.5/site-packages/bzrlib/transform.py", line 613, in _add_tree_children
    list(self.iter_tree_children(parent_id))
  File "/usr/lib/python2.5/site-packages/bzrlib/transform.py", line 632, in iter_tree_children
    yield self.trans_id_tree_path(childpath)
  File "/usr/lib/python2.5/site-packages/bzrlib/transform.py", line 294, in trans_id_tree_path
    path = self.canonical_path(path)
  File "/usr/lib/python2.5/site-packages/bzrlib/transform.py", line 288, in canonical_path
    relpath = self._tree.relpath(abs)
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree.py", line 481, in relpath
    return osutils.relpath(self.basedir, path)
  File "/usr/lib/python2.5/site-packages/bzrlib/osutils.py", line 914, in relpath
    raise errors.PathNotChild(rp, base)
PathNotChild: Path "/home/user/www/hahler_live/web/media/t" is not a child of path "/home/user/www/hahler_de.bzr"

bzr 1.3.1 on python 2.5.2.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'merge', '--force']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'de_DE.UTF-8'
plugins:
  builddeb /usr/lib/python2.5/site-packages/bzrlib/plugins/builddeb [0.92.0dev0]
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.3.0]
  gtk /usr/lib/python2.5/site-packages/bzrlib/plugins/gtk [0.94.0]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  qbzr /usr/lib/python2.5...

Read more...

Daniel Hahler (blueyed)
Changed in bzr:
status: New → Confirmed
description: updated
Revision history for this message
Geoff Bache (geoff.bache) wrote : Re: bzr add <softlink> follows the link

Isn't this a one-line fix? Just calling os.path.samepath in the "osutils.relpath" function instead of expecting "head" and "base" to be identical seems to fix it for me. os.path.samepath doesn't exist on Windows but that should be easy to fix.

I would submit a patch, but I have no idea how to write a test case. So I clicked hopefully on the Guide to Testing Bazaar at
http://doc.bazaar-vcs.org/bzr.dev/en/developer-guide/testing.html, but it appears to be a broken link.

Revision history for this message
Andrew Bennetts (spiv) wrote : Re: [Bug 183831] Re: bzr add <softlink> follows the link

Geoff Bache wrote:
[...]
> I would submit a patch, but I have no idea how to write a test case. So I
> clicked hopefully on the Guide to Testing Bazaar at
> http://doc.bazaar-vcs.org/bzr.dev/en/developer-guide/testing.html, but it
> appears to be a broken link.

The working link is <http://doc.bazaar-vcs.org/bzr.dev/developers/testing.html>

Revision history for this message
Geoff Bache (geoff.bache) wrote : Re: bzr add <softlink> follows the link

OK, thanks for that. I've now put a fix up as lp:~geoff.bache/bzr/trunk and posted to the mailing list.

(I take it someone will fix the broken link from the developer guide, or do we need a new bug for that?)

Revision history for this message
Andrew Bennetts (spiv) wrote : Re: [Bug 183831] Re: bzr add <softlink> follows the link

Geoff Bache wrote:
> OK, thanks for that. I've now put a fix up as lp:~geoff.bache/bzr/trunk
> and posted to the mailing list.

Thanks for that. (Although the preferred way to send fixes is with "bzr send")

> (I take it someone will fix the broken link from the developer guide, or
> do we need a new bug for that?)

A new bug please, describing where the broken link is. I found the working link
by following links from <http://doc.bazaar-vcs.org/>, and didn't notice any
broken links.

Revision history for this message
Geoff Bache (geoff.bache) wrote : Re: bzr add <softlink> follows the link
Martin Pool (mbp)
tags: added: add symlink
removed: ui
summary: - bzr add <softlink> follows the link
+ bzr add <symlink> follows the link
Revision history for this message
Martin Pool (mbp) wrote :

This was fixed prior to 2.0.5. Thanks.

Changed in bzr:
importance: Undecided → Medium
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.