[Bug 4009] New: hg rebase --abort can lose data if the rebasestate is old

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Thu Aug 1 17:00:29 CDT 2013


http://bz.selenic.com/show_bug.cgi?id=4009

          Priority: normal
            Bug ID: 4009
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: hg rebase --abort can lose data if the rebasestate is
                    old
          Severity: bug
    Classification: Unclassified
                OS: Linux
          Reporter: durham at fb.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 2.6.3
         Component: rebase
           Product: Mercurial

When a user upgrades from mercurial <2.6.3 to >2.7-rc, if they have any old
.hg/rebasestate file laying around from an old rebase they forgot to continue,
they will get a message suggesting that they run 'hg rebase --abort' as soon as
they try to update/commit/etc.  rebase --abort then proceeds to wipe all their
pending changes, resulting in data loss.

Repro:
hg init foo
cd foo
hg book @
echo original > a && hg add a && hg commit -m a
echo x > b && hg add b && hg commit -m b1
hg up 0
hg book foo
echo y > b && hg add b && hg commit -m b2
hg rebase -d @ -b foo --config ui.merge=internal:merge
hg resolve --mark --all
# here the users forgets to run hg rebase --continue and keeps working

# mv the rebasestate away temporarily so we're allowed to hg up like in
mercurial <2.6.3
mv .hg/rebasestate ./

# User does other stuff in the repo
hg up -C 0
mv rebasestate .hg/
echo new > a
hg up 1

# user upgrades to 2.7
# user gets an error saying to run hg rebase --abort
cat a
hg rebase --abort
cat a
# the change in file a is lost

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list