[PATCH 3 of 5 V2] amend: use an explicite commit message for temporary amending commit

Sean Farley sean.michael.farley at gmail.com
Sun Aug 26 21:07:47 CDT 2012


[I don't know how pedantic the grammar and spelling should be, so let
me know if this kind of review is unneeded]

On Sat, Aug 25, 2012 at 6:50 PM, Pierre-Yves David
<pierre-yves.david at ens-lyon.org> wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at logilab.fr>
> # Date 1345904441 -7200
> # Node ID 937b0c517131c18c8464604263bb4228390bfa3a
> # Parent  479afc9e76c9f26dace52d7d7fdac1217620b2fd
> amend: use an explicite commit message for temporary amending commit.

amend: use an explicit commit message for temporarily amending a commit

> Before this changeset, the extra commit created during add the same description
> than the final commit. This is a bit confusing when you try to understand what
> that extra commit is about.

Before this changeset, the extra commit used the same description as
the final commit. This is a bit confusing when trying to understand
what that extra commit is about.

> This changeset change the description of such commit to:

This changeset changes the description of such a commit to:

>     temporary amend commit for <ammend-commit-hash>

     temporary amended commit for <ammend-commit-hash>

> This was not big deal but this will be more confusing once we use
> obsolescence marker instead of stripping the precursors.

This was not big deal before but amended will be more confusing once
we use obsolescence markers instead of stripping the precursors.

> This also help if the user restore strip backup.

This also helps if the user restores a strip backup.

>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -1575,10 +1575,14 @@
>          lock = repo.lock()
>          tr = repo.transaction('amend')
>          try:
> +            # See if we got a message from -m or -l, if not, open the editor
> +            # with the message of the changeset to amend
> +            message = logmessage(ui, opts)
>              # First, do a regular commit to record all changes in the working
>              # directory (if there are any)
>              ui.callhooks = False
>              try:
> +                opts['message'] = 'temporary amend commit for %s' % old

 +                opts['message'] = 'temporary amended commit for %s' % old

Everything else looks good to me.


More information about the Mercurial-devel mailing list