backout + shelve?

Yawar Amin yawar.amin at gmail.com
Wed Apr 28 18:20:10 CDT 2010


On 2010-04-28, at 13:19, Neal Becker wrote:

> I have already commited a change, but want to back it out, but still keep it 
> around in case I want to use it later.  Any suggestion?

IIUC, hg backout should be good enough. If you want to use the bad change later, you can hg up to the changeset immediately before the backout, and start working in a new branch.

Below, r1 is the bad change; r2 is the backout; and r3 is continuing work done after the backout. Meanwhile, r4 branches off before the backout (so the bad change is still there) and does some work on top of it. Then r5 merges the two lines.

@    changeset:   5:99906517ce79
|\   tag:         tip
| |  parent:      4:ea6f25651859
| |  parent:      3:8c4790843a74
| |  user:        Yawar Amin <yawar.amin at gmail.com>
| |  date:        Wed Apr 28 19:12:32 2010 -0400
| |  summary:     Get rid of newline char and put in endl manipulator
| |
| o  changeset:   4:ea6f25651859
| |  parent:      1:a14c34a908b7
| |  user:        Yawar Amin <yawar.amin at gmail.com>
| |  date:        Wed Apr 28 19:02:40 2010 -0400
| |  summary:     Use endl everywhere
| |
o |  changeset:   3:8c4790843a74
| |  user:        Yawar Amin <yawar.amin at gmail.com>
| |  date:        Wed Apr 28 19:01:01 2010 -0400
| |  summary:     Fix nasty newline bug
| |
o |  changeset:   2:0137805629c2
|/   user:        Yawar Amin <yawar.amin at gmail.com>
|    date:        Wed Apr 28 19:00:03 2010 -0400
|    summary:     Backed out changeset a14c34a908b7: Undo bad change
|
o  changeset:   1:a14c34a908b7
|  user:        Yawar Amin <yawar.amin at gmail.com>
|  date:        Wed Apr 28 18:59:15 2010 -0400
|  summary:     Bad change but might be useful later
|
o  changeset:   0:840060b358f9
   user:        Yawar Amin <yawar.amin at gmail.com>
   date:        Wed Apr 28 18:58:08 2010 -0400
   summary:     Initial import

HTH,

 Yawar

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
URL: <http://selenic.com/pipermail/mercurial/attachments/20100428/9e76188e/attachment.pgp>


More information about the Mercurial mailing list