How to remove single earlier commit ?

Ben Finney ben+bazaar at benfinney.id.au
Fri Nov 6 01:47:15 GMT 2009


"Richard B." <dj_deipotent at yahoo.co.uk> writes:

> I was following the discussion on the "Comparison with Git, Mercurial
> or Darcs?" topic, where someone brought up the scenario of:
>
> Commit A
> Commit B
> Commit C

Let's call these actual revision numbers, since that's what you'll use
in the UI::

    Revision 1
    Revision 2
    Revision 3

> but then you find out you want to undo only [revision 1], while
> keeping [revisions 2 and 3].

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
    $ bzr commit --message "Fix blunder introduced in the flooble module."

Unfortunately, the ‘revert’ command doesn't — in Bazaar 1.17 which I'm
using — support the common ‘--change N’ option (which is effectively a
shortcut for the above one-step range of revisions).

-- 
 \          “One bad programmer can easily create two new jobs a year. |
  `\      Hiring more bad programmers will just increase our perceived |
_o__)                     need for them.” —David Lorge Parnas, 1999-03 |
Ben Finney




More information about the bazaar mailing list