Mercurial > hg
changeset 30815:c5bf2e8ec18c
convert: remove "replacecommitter" action
As pointed out by Yuya, this action doesn't add much (any?) value.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 14 Jan 2017 10:11:19 -0800 |
parents | b96c57c1f860 |
children | 96f811bceb85 |
files | hgext/convert/__init__.py hgext/convert/git.py tests/test-convert-git.t tests/test-convert.t |
diffstat | 4 files changed, 3 insertions(+), 60 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/convert/__init__.py Sat Jan 14 20:31:35 2017 +0900 +++ b/hgext/convert/__init__.py Sat Jan 14 10:11:19 2017 -0800 @@ -355,9 +355,6 @@ 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
--- a/hgext/convert/git.py Sat Jan 14 20:31:35 2017 +0900 +++ b/hgext/convert/git.py Sat Jan 14 10:11:19 2017 -0800 @@ -133,28 +133,21 @@ 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 @@ if self.committeractions['dropcommitter']: committer = None - - if self.committeractions['replacecommitter']: - committer = author elif self.committeractions['replaceauthor']: author = committer
--- a/tests/test-convert-git.t Sat Jan 14 20:31:35 2017 +0900 +++ b/tests/test-convert-git.t Sat Jan 14 10:11:19 2017 -0800 @@ -491,12 +491,7 @@ $ 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 @@ 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 @@ -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 <test@example.org> - date: Mon Jan 01 00:00:21 2007 +0000 - files: foo - description: - addfoo2 - - - changeset: 0:0735477b0224 - user: test <test@example.org> - 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
--- a/tests/test-convert.t Sat Jan 14 20:31:35 2017 +0900 +++ b/tests/test-convert.t Sat Jan 14 10:11:19 2017 -0800 @@ -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