[PATCH] backout: add examples to clarify basic usage
Mathias De Maré
mathias.demare at gmail.com
Mon Oct 5 00:16:19 CDT 2015
On Mon, Oct 5, 2015 at 2:27 AM, Pierre-Yves David <
pierre-yves.david at ens-lyon.org> wrote:
>
>
> On 10/01/2015 10:48 PM, Mathias De Maré wrote:
>
>> # HG changeset patch
>> # User Mathias De Maré <mathias.demare at gmail.com>
>> # Date 1443764903 -7200
>> # Fri Oct 02 07:48:23 2015 +0200
>> # Node ID 68ff3f5f6abd15e786dfac4ee3259f0fdbca441a
>> # Parent 97dc6ab42aad232c73180dee648685c26662230b
>> backout: add examples to clarify basic usage
>>
>
> This one was incorrectly dropped from patchwork. This seems fine to me but
> would like at least a second opinions.
>
>
> diff --git a/mercurial/commands.py b/mercurial/commands.py
>> --- a/mercurial/commands.py
>> +++ b/mercurial/commands.py
>> @@ -485,6 +485,56 @@
>>
>> .. container:: verbose
>>
>> + Some examples:
>> +
>> + - Reverse the effect of the parent of the working directory.
>> + This backout will be committed immediately::
>> +
>> + hg backout -r .
>> +
>> + - reverse the effect of previous bad revision 23::
>> +
>> + hg backout -r 23
>> + hg commit -m "Backout revision 23"
>> +
>> + - reverse the effect of previous bad revision 23 and
>> + commit the backout immediately::
>> +
>> + hg backout -r 23 --commit
>> +
>> + - Reverse the effect of a previous change
>> + and add the backout in the history as a merge.
>> + This clearly shows the link to the backed out
>> + changeset.
>> +
>> + Before the backout::
>> +
>> + @ 2
>> + |
>> + |
>> + o 1
>> + |
>> + |
>> + o 0
>> +
>> + Backout command::
>> +
>> + hg backout -r 1 --merge
>> +
>> + After the backout, we have a merge that still needs
>> + to be committed::
>> +
>> + @ 3 Backed out revision 1
>> + |
>> + |
>> + | @ 2
>> + |/
>> + |
>> + o 1
>> + |
>> + |
>> + o 0
>> +
>> By default, the pending changeset will have one parent,
>> maintaining a linear history. With --merge, the pending
>> changeset will instead have two parents: the old parent of the
>> @@ -497,6 +547,9 @@
>>
>> See :hg:`help dates` for a list of formats valid for -d/--date.
>>
>> + See :hg:`help revert` for a way to restore files to the state
>> + of another revision.
>> +
>>
>
> You probably want to put that one add in its own patch because it is
> obviously correct and won't spawn any discussion.
I pushed a V2 into push-gate (which apparently got smart enough to add 'V2'
itself :-)).
>
>
> --
> Pierre-Yves David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20151005/c3d9baa2/attachment.html>
More information about the Mercurial-devel
mailing list