[Bug 5628] New: rebasing symlinks and directories leads to broken experience
mercurial-bugs at mercurial-scm.org
mercurial-bugs at mercurial-scm.org
Fri Jul 21 14:07:10 UTC 2017
https://bz.mercurial-scm.org/show_bug.cgi?id=5628
Bug ID: 5628
Summary: rebasing symlinks and directories leads to broken
experience
Product: Mercurial
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: bug
Priority: wish
Component: rebase
Assignee: bugzilla at mercurial-scm.org
Reporter: rm at fb.com
CC: mercurial-devel at mercurial-scm.org
There is a way to get into a totally broken repo -- one that you can apparently
not update in any way -- using symlinks and rebase.
The behavior today is different than the behavior was when I first discovered
something similar about a year ago. Back then, the rebase would abort and the
user would need to run `hg rebase --abort` to get back to a good state. Today,
the behavior is probably worse: the rebase completes, and the user has no hg
commands they could run to continue to do any work.
Here's a test script:
Set up symlink hell
$ hg init repo
$ cd repo
$ touch base
$ hg add base
$ hg commit -m base
$ ln -s b a
$ hg add a
$ hg commit -m a2b
$ hg up .^
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ mkdir a
$ touch a/c
$ hg add a/c
$ hg commit -m a/c
created new head
$ mkdir b
$ hg rebase -s 2 -d 1 --config extensions.rebase=
rebasing 2:0044ff20c17d "a/c" (tip)
saved backup bundle to * (glob)
What The?
$ hg status
! a/c
? b/c
Oh No!
$ hg update .^
abort: path 'a/c' traverses symbolic link 'a'
[255]
$ hg update --clean .^
abort: path 'a/c' traverses symbolic link 'a'
[255]
$ hg update --clean null
abort: path 'a/c' traverses symbolic link 'a'
[255]
Haha, you screwed now!
$ cd ..
Another terrible outcome (mkdir b is removed from above example)
$ hg init repo2
$ cd repo2
$ touch base
$ hg add base
$ hg commit -m base
$ ln -s b a
$ hg add a
$ hg commit -m a2b
$ hg up .^
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ mkdir a
$ touch a/c
$ hg add a/c
$ hg commit -m a/c
created new head
$ hg rebase -s 2 -d 1 --config extensions.rebase=
rebasing 2:0044ff20c17d "a/c" (tip)
abort: No such file or directory: $TESTTMP/repo2/a/c (glob)
[255]
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Mercurial-devel
mailing list