How to remove single earlier commit ?

John Arbash Meinel john at arbash-meinel.com
Fri Nov 6 03:29:29 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Matthew D. Fuller wrote:
> On Fri, Nov 06, 2009 at 12:47:15PM +1100 I heard the voice of
> Ben Finney, and lo! it spake thus:
>> Revert the changes you decide you don't like (to get the working tree in
>> the right state), then commit the working tree state describing what you
>> did.
>>
>>     $ bzr revert --revision 0..1
> 
> Er.  No.  'revert' doesn't support -c for the very good reason that
> revert doesn't have any meaning when given two revisions in the first
> place.  revert -r0..1 is an error.  Revert takes a SINGLE revision,
> because it only makes sense to set the file state to a single
> revision.
> 
> That you WANT here is something like "bzr merge -r1..0 .", to merge
> forward the OPPOSITE of the 0..1 change.

Matthew is right, it's even documented in "bzr help revert":

To remove only some changes, without reverting to a prior version, use
merge instead.  For example, "merge . --revision -2..-3" will remove the
changes introduced by -2, without affecting the changes introduced by -1.
Or to remove certain changes on a hunk-by-hunk basis, see the Shelf plugin.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrzmBkACgkQJdeBCYSNAAOmbACffLmeCANwQMsiz0u+zEgAp4Y5
fU8AoNRuOwRfJ7FPJdsldoPy0AjNPelR
=C/kP
-----END PGP SIGNATURE-----



More information about the bazaar mailing list