Issue1289

Title Rollback after rebase corrupts dirstate
Priority bug Status resolved
Superseder Nosy List abuehl, astratto, djc, durin42, mpm
Assigned To astratto Topics

Created on 2008-09-05.16:42:23 by durin42, last changed 2008-11-02.13:05:19 by djc.

Messages
msg7764 (view) Author: djc Date: 2008-11-02.13:05:19
In main, resolving.
msg7488 (view) Author: djc Date: 2008-10-18.15:13:39
I have pushed this to crew as 204c7850c158.
msg6993 (view) Author: djc Date: 2008-09-08.11:27:52
Well, there are cases where you can still rollback after stripping, for example,
a side branch (while the latest commit was against your normal branch). On the
other hand, removing undo after strip extracts that from all the callers, which
is kind of nice. Maybe make it an option for strip?
msg6968 (view) Author: astratto Date: 2008-09-06.08:33:00
Patch sent to mercurial-devel, thanks.

http://article.gmane.org/gmane.comp.version-control.mercurial.devel/18002

Matt, should we consider disallow rollback after every strip operation in general?
msg6955 (view) Author: mpm Date: 2008-09-05.19:37:13
Correcting title, as the repo itself is intact

I've reproduced the behavior with the following script:

#!/bin/sh
rm -rf a
hg init a
cd a

echo 0 > a
hg ci -Am0
echo 1 > a
hg ci -Am0
hg co 0
echo 2 > b
hg ci -Am1
hg co -C 1
hg rebase
hg rollback
hg st
hg verify

To fix a repo in this state, use "hg debugrebuildstate -r tip".

You can't actually meaningfully 'roll back' a rebase because rebase
destructively modifies history. But nonetheless, we should avoid hitting this
case by removing .hg/store/undo before and after a strip operation.
msg6954 (view) Author: durin42 Date: 2008-09-05.16:42:22
Rolling back after doing a rebase has (repeatably) left me with a repo that can't 
be used because of errors like this:
abort: unknown revision '8993e0272dec2bbd9d60b6124e74d97a1dd5a1c6'!
History
Date User Action Args
2008-11-02 13:05:19djcsetstatus: testing -> resolved
messages: + msg7764
2008-10-18 15:13:40djcsetstatus: in-progress -> testing
messages: + msg7488
2008-09-08 11:27:53djcsetnosy: + djc
messages: + msg6993
2008-09-06 08:33:01astrattosetstatus: chatting -> in-progress
messages: + msg6968
2008-09-05 19:37:16mpmsetstatus: unread -> chatting
assignedto: astratto
messages: + msg6955
nosy: + astratto, mpm
title: Rollback after rebase corrupts repo -> Rollback after rebase corrupts dirstate
2008-09-05 17:01:51abuehlsetnosy: + abuehl
2008-09-05 16:42:23durin42create