Patchwork histedit: remove history_source

login
register
mail settings
Submitter Boris Penev
Date July 30, 2014, 1:56 a.m.
Message ID <4076ff9a7bb016e779da.1406685379@localhost.localdomain>
Download mbox | patch
Permalink /patch/5210/
State Rejected
Headers show

Comments

Boris Penev - July 30, 2014, 1:56 a.m.
# HG changeset patch
# User Boris Penev <bob53181@yahoo.com>
# Date 1406685063 -3600
#      Wed Jul 30 02:51:03 2014 +0100
# Branch stable
# Node ID 4076ff9a7bb016e779da879c77b2de2e0e79a082
# Parent  ad56fc55cbc3870d257e163469c687088627283b
histedit: remove history_source

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. 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.

Patch

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)