atom feed58 messages in com.selenic.mercurialRe: How I deleted my new files with g...
FromSent OnAttachments
Jørgen AustvikJun 28, 2010 12:19 am 
Mina R WaheebJun 28, 2010 1:03 am 
Anton ShestakovJun 28, 2010 1:10 am 
Jens...@sew-eurodrive.deJun 28, 2010 1:19 am 
Nicolas DumazetJun 28, 2010 2:00 am 
Nicolas DumazetJun 28, 2010 2:26 am 
Robert Bauck HamarJun 28, 2010 2:49 am 
Matt MackallJun 28, 2010 7:17 am 
Jørgen AustvikJun 28, 2010 8:08 am 
Daniel CarreraJun 28, 2010 8:10 am 
Jørgen AustvikJun 28, 2010 8:11 am 
Jørgen AustvikJun 28, 2010 8:16 am 
Daniel CarreraJun 28, 2010 8:23 am 
Jørgen AustvikJun 28, 2010 8:24 am 
Jørgen AustvikJun 28, 2010 8:39 am 
Jørgen AustvikJun 28, 2010 8:52 am 
Jørgen AustvikJun 28, 2010 9:52 am 
Daniel CarreraJun 28, 2010 10:35 am 
Robert Bauck HamarJun 28, 2010 10:41 am 
Matt MackallJun 28, 2010 10:45 am 
Jørgen AustvikJun 28, 2010 10:46 am 
Daniel CarreraJun 28, 2010 10:46 am 
Jørgen AustvikJun 28, 2010 10:51 am 
Daniel CarreraJun 28, 2010 10:59 am 
Matt MackallJun 28, 2010 11:23 am 
Jason HarrisJun 28, 2010 11:36 am 
Daniel CarreraJun 28, 2010 1:49 pm 
Matt MackallJun 28, 2010 1:59 pm 
Adrian BuehlmannJun 28, 2010 2:03 pm 
Daniel CarreraJun 28, 2010 2:17 pm 
Daniel CarreraJun 28, 2010 2:52 pm 
Jon RibbensJun 28, 2010 3:57 pm 
Mads KiilerichJun 28, 2010 4:58 pm 
Matt MackallJun 28, 2010 9:22 pm 
Daniel CarreraJun 29, 2010 12:48 am 
Matt MackallJun 29, 2010 7:09 am 
Daniel CarreraJun 29, 2010 8:57 am 
Pierre AsselinJun 29, 2010 5:28 pm 
Daniel CarreraJun 29, 2010 11:26 pm 
Gilles MorisJun 29, 2010 11:52 pm 
Jason HarrisJun 30, 2010 12:04 am 
Daniel CarreraJun 30, 2010 1:01 am 
Greg WardJun 30, 2010 6:49 am 
Daniel CarreraJun 30, 2010 8:48 am 
Martin GeislerJun 30, 2010 9:11 am 
Daniel CarreraJun 30, 2010 11:41 am 
Steve BorhoJun 30, 2010 11:48 am 
Daniel CarreraJun 30, 2010 11:53 am 
Steve LoshJun 30, 2010 12:02 pm 
Daniel CarreraJun 30, 2010 12:05 pm 
Jason HarrisJun 30, 2010 12:08 pm 
Steve BorhoJun 30, 2010 12:10 pm 
Daniel CarreraJun 30, 2010 12:37 pm 
Giorgos KeramidasJun 30, 2010 3:30 pm 
Giorgos KeramidasJun 30, 2010 3:32 pm 
Wagner BrunaJul 1, 2010 3:13 pm 
Daniel CarreraJul 1, 2010 8:19 pm 
Johan SamynJul 3, 2010 10:14 am 
Subject:Re: How I deleted my new files with good help from Mercurial
From:Matt Mackall (mp@selenic.com)
Date:Jun 28, 2010 11:23:02 am
List:com.selenic.mercurial

On Mon, 2010-06-28 at 20:00 +0200, Daniel Carrera wrote:

On Mon, Jun 28, 2010 at 7:46 PM, Matt Mackall <mp@selenic.com> wrote:

He probably actually managed to abort the backout the first time around.

Indeed... I just tried "hg backout" with an empty commit message, and I think I have reproduced Jørgen's problem:

1) Start with a repository with one commit only:

% ls file-A % hg log changeset: 0:218a0afc8e6c user: Daniel Carrera <dcar@gmail.com> date: Mon Jun 28 19:48:14 2010 +0200 summary: Initial commit

2) Reproduce the error:

% touch deleteme % hg add deleteme % hg commit -m 'Bad commit'

At this point Jørgen ran "hg backout tip", he saw a text editor, and he *removed* the commit message, leaving the file blank. He was trying to abort the backout, and it sort of succeeded:

% hg backout tip (erase the commit message and save) removing deleteme abort: empty commit message % hg log changeset: 1:59c7f10682a8 tag: tip user: Daniel Carrera <dcar@gmail.com> date: Mon Jun 28 19:48:37 2010 +0200 summary: Bad commit

changeset: 0:218a0afc8e6c user: Daniel Carrera <dcar@gmail.com> date: Mon Jun 28 19:48:14 2010 +0200 summary: Initial commit % hg ls file-A

Now, the "backout" action was aborted, but it nonetheless deleted the file.

I think *THIS* is the key issue: If you abort a "backout", Mercurial will *STILL* remove the files.

That's fine and as designed. Backout is basically three steps rolled into one:

- update -C <rev> - revert -r <parent of rev> - commit

There's a fourth step that's done automatically if you specify --merge:

- merge with changeset we were at when we started

And there's a fifth, manual step:

- commit the result of merging with the backout changeset

When step 3 (commit) aborts, you're left with the first two steps completed and you can either commit yourself or up -C to abandon the process.

Of course, if you "rollback" now, you lose your previous commit and Jørgen's data is gone forever.

Of course. This is -the only way to lose history- with core Mercurial. Spreading the blame to other commands is pointless.

I think this points to a legitimate issue with Mercurial: If the "backout" command aborts, it *should* *not* delete the files. To me, "abort" means "abort", it means that the aborting command does not go ahead and make the change that it claimed to have aborted.

The changes were already made and can be undone with an update -C.

There are lots of things that suck about backout but this is not one of them: any plausible replacement would do its dirty work in the working directory too.

(A plausible replacement would look like backout + rebase, with only one linear changeset recorded)