On ArchLinux (and maybe others) `/lib` is a symbolic link. This breaks mercurial when the repository contains a folder named `lib` in the repository root. Here how you can reproduce the bug: cd /tmp # !!!!!!!!!! clean up things for the test !!!!!!!!!!!!!!!! rm -r lib lib_ repo # Create a symbolic link that will cause troubles mkdir lib_ ln -s lib_ lib # Create a repository with a similar structure than /tmp/lib → tmp/lib # In my case, I just have a directory named `lib`. hg init repo cd repo mkdir -p tmp/lib touch tmp/lib/a hg add tmp/lib/a hg ci -m 'a' # Prepare something to rebase touch tmp/lib/b hg add tmp/lib/b hg ci -m 'b' hg up .^ touch tmp/lib/c hg add tmp/lib/c hg ci -m 'c' # The following fails with # "abort: path 'tmp/lib/b' traverses symbolic link 'tmp/lib'" # because of matchmod.match('/', '', [path + '/'], default=b'relpath') # in mercurial/context.py(2143) hg rebase -s 1 -d .
Confirmed with rebase.experimental.inmemory=True. Maybe we'll need to specify a pathauditor of realfs=False explicitly? $ cat <<'EOF' > "$HGRCPATH" > [extensions] > rebase = > [rebase] > experimental.inmemory = True > EOF Create a symbolic link that will cause troubles $ mkdir lib_ $ ln -s lib_ lib Create a repository with a similar structure than /tmp/lib -> tmp/lib In my case, I just have a directory named `lib`. $ hg init repo $ cd repo $ mkdir -p ".$TESTTMP/lib" $ touch ".$TESTTMP/lib/a" $ hg add ".$TESTTMP/lib/a" $ hg ci -m 'a' Prepare something to rebase $ touch ".$TESTTMP/lib/b" $ hg add ".$TESTTMP/lib/b" $ hg ci -m 'b' $ hg up -q '.^' $ touch ".$TESTTMP/lib/c" $ hg add ".$TESTTMP/lib/c" $ hg ci -m 'c' created new head XXX The following fails $ hg rebase -s 1 -d . rebasing 1:* "b" (glob) abort: path '*/b' traverses symbolic link '*/lib' (glob) [255]
That entire function can actually be replaced by a config override of `experimental.merge.checkpathconflicts=Tru8e` around in-memory merge.
Bug was inactive for 150 days, archiving
*** Bug 6027 has been marked as a duplicate of this bug. ***
Fixed by https://mercurial-scm.org/repo/hg/rev/1c8c54cf9725 Martin von Zweigbergk <martinvonz@google.com> rebase: fix path auditing to audit path relative to repo root (issue5818) Before this patch, when rebasing a file called "foo/bar", we would check e.g. if "/foo" (i.e. rooted at the file system root) was a symlink. Differential Revision: https://phab.mercurial-scm.org/D5361 (please test the fix)
Bug was set to TESTING for 7 days, resolving