# HG changeset patch # User Gregory Szorc # Date 2017-01-14 18:11:19 # Node ID c5bf2e8ec18cd1dbdc69c63d27464f0979292ad6 # Parent b96c57c1f860f856958715b0bff00e1daff23175 convert: remove "replacecommitter" action As pointed out by Yuya, this action doesn't add much (any?) value. diff --git a/hgext/convert/__init__.py b/hgext/convert/__init__.py --- a/hgext/convert/__init__.py +++ b/hgext/convert/__init__.py @@ -355,9 +355,6 @@ def convert(ui, src, dest=None, revmapfi the committer. Other actions that add references to the committer will still take effect when this is set. - ``replacecommitter`` will replace the value of the committer field - with the author. - The default is ``messagedifferent``. :convert.git.extrakeys: list of extra keys from commit metadata to copy to diff --git a/hgext/convert/git.py b/hgext/convert/git.py --- a/hgext/convert/git.py +++ b/hgext/convert/git.py @@ -133,28 +133,21 @@ class convert_git(common.converter_sourc dropcommitter = 'dropcommitter' in committeractions replaceauthor = 'replaceauthor' in committeractions - replacecommitter = 'replacecommitter' in committeractions - if dropcommitter and (replaceauthor or replacecommitter): + if dropcommitter and replaceauthor: raise error.Abort(_('committeractions cannot define both ' - 'dropcommitter and ' - 'replaceauthor/replacecommitter')) + 'dropcommitter and replaceauthor')) if dropcommitter and messagealways: raise error.Abort(_('committeractions cannot define both ' 'dropcommitter and messagealways')) - if replaceauthor and replacecommitter: - raise error.Abort(_('committeractions cannot define both ' - 'replaceauthor and replacecommitter')) - if not messagedifferent and not messagealways: messagedifferent = 'committer:' self.committeractions = { 'dropcommitter': dropcommitter, 'replaceauthor': replaceauthor, - 'replacecommitter': replacecommitter, 'messagedifferent': messagedifferent, 'messagealways': messagealways, } @@ -368,9 +361,6 @@ class convert_git(common.converter_sourc if self.committeractions['dropcommitter']: committer = None - - if self.committeractions['replacecommitter']: - committer = author elif self.committeractions['replaceauthor']: author = committer diff --git a/tests/test-convert-git.t b/tests/test-convert-git.t --- a/tests/test-convert-git.t +++ b/tests/test-convert-git.t @@ -491,12 +491,7 @@ Various combinations of committeractions $ hg --config convert.git.committeractions=dropcommitter,replaceauthor convert git-repo4 bad-committer initializing destination bad-committer repository - abort: committeractions cannot define both dropcommitter and replaceauthor/replacecommitter - [255] - - $ hg --config convert.git.committeractions=dropcommitter,replacecommitter convert git-repo4 bad-committer - initializing destination bad-committer repository - abort: committeractions cannot define both dropcommitter and replaceauthor/replacecommitter + abort: committeractions cannot define both dropcommitter and replaceauthor [255] $ hg --config convert.git.committeractions=dropcommitter,messagealways convert git-repo4 bad-committer @@ -504,11 +499,6 @@ Various combinations of committeractions abort: committeractions cannot define both dropcommitter and messagealways [255] - $ hg --config convert.git.committeractions=replaceauthor,replacecommitter convert git-repo4 bad-committer - initializing destination bad-committer repository - abort: committeractions cannot define both replaceauthor and replacecommitter - [255] - custom prefix on messagedifferent works $ hg --config convert.git.committeractions=messagedifferent=different: convert git-repo4 git-repo4-hg-messagedifferentprefix @@ -643,37 +633,6 @@ replaceauthor replaces author with commi -replacecommitter replaces committer with author - - $ hg --config convert.git.committeractions=replacecommitter convert git-repo4 git-repo4-hg-replacecommitter - initializing destination git-repo4-hg-replacecommitter repository - scanning source... - sorting... - converting... - 1 addfoo - 0 addfoo2 - updating bookmarks - - $ hg -R git-repo4-hg-replacecommitter log -v - changeset: 1:190b2da396cc - bookmark: master - tag: tip - user: nottest - date: Mon Jan 01 00:00:21 2007 +0000 - files: foo - description: - addfoo2 - - - changeset: 0:0735477b0224 - user: test - date: Mon Jan 01 00:00:20 2007 +0000 - files: foo - description: - addfoo - - - dropcommitter removes the committer $ hg --config convert.git.committeractions=dropcommitter convert git-repo4 git-repo4-hg-dropcommitter diff --git a/tests/test-convert.t b/tests/test-convert.t --- a/tests/test-convert.t +++ b/tests/test-convert.t @@ -297,9 +297,6 @@ committer. Other actions that add references to the committer will still take effect when this is set. - "replacecommitter" will replace the value of the committer field with - the author. - The default is "messagedifferent". convert.git.extrakeys