[PATCH] backout: provide linear backout as a default (without --merge option)

timeless timeless at gmail.com
Mon Oct 11 00:41:50 CDT 2010


On Tue, Sep 21, 2010 at 2:53 PM, Gilles Moris <gilles.moris at free.fr> wrote:
> # HG changeset patch
> # User Gilles Moris <gilles.moris at free.fr>
> # Date 1284107298 -7200
> # Node ID 478385c46665cdc7192e0f876a2e8b2bc957f2fc
> # Parent  17feeef6da9ed761c416d3b054dc7cc0247e6269
> backout: provide linear backout as a default (without --merge option)
>
> This change enables to have a backout changeset that will keep the

This changes backout changeset to retain linear history,

> history linear, i.e. committed as a child of the working directory parent.

i.e. it is committed as a child of the working directory parent, not
the backed out changeset parent.

> The default behavior was previously to just commit a reverted change as a

-- you use behavior (en-US) here.

> child of the backed out changeset and thus creating a new head.

changeset - thus creating a new head.

> Most of
> the time, you would use the --merge option, as it does not make sense to
> keep this dangling head as is.

> The previous behavior can be restored using 'hg update --clean .' after a

The previous behavior can be obtained by using ...

> 'hg backout --merge'.

------ Does this actually work?

> The --merge option itself is not affected by this change. There is also
> still an autocommit of the backout if a merge is not needed, i.e. in case
> of the backout of the parent of the working directory.

... in case the backoutis of the working directory parent.

> So previously we had (pwd = parent of the working directory):

Previously we had....

>                  pwd     older
> backout           auto    merge
> backout --merge   auto    commit
>
> With the new linear approach:
>                  pwd     older
> backout           auto    commit
> backout --merge   auto    commit
>
> auto: commit done by the backout command
> merge: backout also already committed but explicit merge and commit needed
> commit: user need to commit the update/merge

> +    The backout command merges the reverse effect of the backed out
> +    changeset into the working directory.
> +
> +    With the --merge option, it first commit the backed out changes

... it first commits ...

> +    as a new changeset. This new changeset is a child of the backed
> +    out changeset.

-- Personally i'm not a fan of "backed out" and would prefer
"reverted" (global comment).

>     The --merge option remembers the parent of the working directory
>     before starting the backout, then merges the new head with that
> +    changeset afterwards.
> +    This will result in an explicit merge in the history log.

-- I'm not sure "history log" is how we'd right this.

> +    If you backout a changeset other than the original parent of the
> +    working directory, the result of this merge is not committed,
> +    as with a normal merge. Otherwise, no merge is needed and the
> +    commit is automatic.
> +
> +    Note that the default behavior (without --merge) has changed in
> +    version 1.7. To restore the previous default behaviour, use

-- you use behaviour (en-GB) here. Do not use both. I believe
mercurial is supposed to be en-US.


More information about the Mercurial-devel mailing list