[PATCH] histedit: remove history_source

Augie Fackler lists at durin42.com
Wed Jul 30 13:15:24 CDT 2014


On Tue, Jul 29, 2014 at 9:53 PM, Boris Penev <bob53181 at yahoo.com> wrote:
> # HG changeset patch
> # User Boris Penev <bob53181 at yahoo.com>
> # Date 1406685063 -3600
> #      Wed Jul 30 02:51:03 2014 +0100
> # Branch stable
> # Node ID 4076ff9a7bb016e779da879c77b2de2e0e79a082
> # Parent  ad56fc55cbc3870d257e163469c687088627283b
> histedit: remove history_source

No thanks.

> History source is polluting the commit messages. This is
> visible when converting the repository to git but the fact that
> it stays in the history is bad enough by itself.

Ignoring hg-git, why do you care about some invisible metadata in your history?

> This patch
> removes the needless logging. I do not know why you would need
> this but it possibly could be non-default, activated by an
> argument to the histedit command.
>
> diff -r ad56fc55cbc3 -r 4076ff9a7bb0 hgext/histedit.py
> --- a/hgext/histedit.py Mon Jul 28 10:05:17 2014 +0200
> +++ b/hgext/histedit.py Wed Jul 30 02:51:03 2014 +0100
> @@ -188,8 +188,6 @@
>
>      This function ensure we apply the same treatment to all changesets.
>
> -    - Add a 'histedit_source' entry in extra.
> -
>      Note that fold have its own separated logic because its handling is a bit
>      different and not easily factored out of the fold method.
>      """
> @@ -199,9 +197,6 @@
>          try:
>              repo.ui.setconfig('phases', 'new-commit', phasemin,
>                                'histedit')
> -            extra = kwargs.get('extra', {}).copy()
> -            extra['histedit_source'] = src.hex()
> -            kwargs['extra'] = extra
>              return repo.commit(**kwargs)
>          finally:
>              repo.ui.restoreconfig(phasebackup)
> @@ -289,7 +284,6 @@
>          message = first.description()
>      user = commitopts.get('user')
>      date = commitopts.get('date')
> -    extra = commitopts.get('extra')
>
>      parents = (first.p1().node(), first.p2().node())
>      new = context.memctx(repo,
> @@ -299,7 +293,6 @@
>                           filectxfn=filectxfn,
>                           user=user,
>                           date=date,
> -                         extra=extra,
>                           editor=cmdutil.getcommiteditor(edit=True))
>      return repo.commitctx(new)
>
> @@ -316,7 +309,7 @@
>      # drop the second merge parent
>      commit = commitfuncfor(repo, oldctx)
>      n = commit(text=oldctx.description(), user=oldctx.user(),
> -               date=oldctx.date(), extra=oldctx.extra())
> +               date=oldctx.date())
>      if n is None:
>          ui.warn(_('%s: empty changeset\n')
>                       % node.hex(ha))
> @@ -341,7 +334,7 @@
>          raise error.InterventionRequired(
>              _('Fix up the change and run hg histedit --continue'))
>      n = repo.commit(text='fold-temp-revision %s' % ha, user=oldctx.user(),
> -                    date=oldctx.date(), extra=oldctx.extra())
> +                    date=oldctx.date())
>      if n is None:
>          ui.warn(_('%s: empty changeset')
>                       % node.hex(ha))
> @@ -367,12 +360,6 @@
>      commitopts['message'] = newmessage
>      # date
>      commitopts['date'] = max(ctx.date(), oldctx.date())
> -    extra = ctx.extra().copy()
> -    # histedit_source
> -    # note: ctx is likely a temporary commit but that the best we can do here
> -    #       This is sufficient to solve issue3681 anyway
> -    extra['histedit_source'] = '%s,%s' % (ctx.hex(), oldctx.hex())
> -    commitopts['extra'] = extra
>      phasebackup = repo.ui.backupconfig('phases', 'new-commit')
>      try:
>          phasemin = max(ctx.phase(), oldctx.phase())
> @@ -405,7 +392,6 @@
>      message = oldctx.description()
>      commit = commitfuncfor(repo, oldctx)
>      new = commit(text=message, user=oldctx.user(), date=oldctx.date(),
> -                 extra=oldctx.extra(),
>                   editor=cmdutil.getcommiteditor(edit=True))
>      newctx = repo[new]
>      if oldctx.node() != newctx.node():
> @@ -686,7 +672,7 @@
>          editor = cmdutil.getcommiteditor(edit=editopt)
>          commit = commitfuncfor(repo, ctx)
>          new = commit(text=message, user=ctx.user(),
> -                     date=ctx.date(), extra=ctx.extra(),
> +                     date=ctx.date(),
>                       editor=editor)
>          if new is not None:
>              newchildren.append(new)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list