Submitter | Mathias De Maré |
---|---|
Date | Oct. 2, 2015, 5:48 a.m. |
Message ID | <68ff3f5f6abd15e786df.1443764928@waste.org> |
Download | mbox | patch |
Permalink | /patch/10735/ |
State | Superseded |
Commit | 7a95c1e0748793f6f58c99d6442cdc7f0840227c |
Headers | show |
Comments
On 10/01/2015 10:48 PM, Mathias De Maré wrote: > # HG changeset patch > # User Mathias De Maré <mathias.demare@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.
On Mon, Oct 5, 2015 at 2:27 AM, Pierre-Yves David < pierre-yves.david@ens-lyon.org> wrote: > > > On 10/01/2015 10:48 PM, Mathias De Maré wrote: > >> # HG changeset patch >> # User Mathias De Maré <mathias.demare@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 >
Patch
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. + Returns 0 on success, 1 if nothing to backout or there are unresolved files. '''