Show More
@@ -355,9 +355,6 b' def convert(ui, src, dest=None, revmapfi' | |||||
355 | the committer. Other actions that add references to the committer |
|
355 | the committer. Other actions that add references to the committer | |
356 | will still take effect when this is set. |
|
356 | will still take effect when this is set. | |
357 |
|
357 | |||
358 | ``replacecommitter`` will replace the value of the committer field |
|
|||
359 | with the author. |
|
|||
360 |
|
||||
361 | The default is ``messagedifferent``. |
|
358 | The default is ``messagedifferent``. | |
362 |
|
359 | |||
363 | :convert.git.extrakeys: list of extra keys from commit metadata to copy to |
|
360 | :convert.git.extrakeys: list of extra keys from commit metadata to copy to |
@@ -133,28 +133,21 b' class convert_git(common.converter_sourc' | |||||
133 |
|
133 | |||
134 | dropcommitter = 'dropcommitter' in committeractions |
|
134 | dropcommitter = 'dropcommitter' in committeractions | |
135 | replaceauthor = 'replaceauthor' in committeractions |
|
135 | replaceauthor = 'replaceauthor' in committeractions | |
136 | replacecommitter = 'replacecommitter' in committeractions |
|
|||
137 |
|
136 | |||
138 |
if dropcommitter and |
|
137 | if dropcommitter and replaceauthor: | |
139 | raise error.Abort(_('committeractions cannot define both ' |
|
138 | raise error.Abort(_('committeractions cannot define both ' | |
140 | 'dropcommitter and ' |
|
139 | 'dropcommitter and replaceauthor')) | |
141 | 'replaceauthor/replacecommitter')) |
|
|||
142 |
|
140 | |||
143 | if dropcommitter and messagealways: |
|
141 | if dropcommitter and messagealways: | |
144 | raise error.Abort(_('committeractions cannot define both ' |
|
142 | raise error.Abort(_('committeractions cannot define both ' | |
145 | 'dropcommitter and messagealways')) |
|
143 | 'dropcommitter and messagealways')) | |
146 |
|
144 | |||
147 | if replaceauthor and replacecommitter: |
|
|||
148 | raise error.Abort(_('committeractions cannot define both ' |
|
|||
149 | 'replaceauthor and replacecommitter')) |
|
|||
150 |
|
||||
151 | if not messagedifferent and not messagealways: |
|
145 | if not messagedifferent and not messagealways: | |
152 | messagedifferent = 'committer:' |
|
146 | messagedifferent = 'committer:' | |
153 |
|
147 | |||
154 | self.committeractions = { |
|
148 | self.committeractions = { | |
155 | 'dropcommitter': dropcommitter, |
|
149 | 'dropcommitter': dropcommitter, | |
156 | 'replaceauthor': replaceauthor, |
|
150 | 'replaceauthor': replaceauthor, | |
157 | 'replacecommitter': replacecommitter, |
|
|||
158 | 'messagedifferent': messagedifferent, |
|
151 | 'messagedifferent': messagedifferent, | |
159 | 'messagealways': messagealways, |
|
152 | 'messagealways': messagealways, | |
160 | } |
|
153 | } | |
@@ -368,9 +361,6 b' class convert_git(common.converter_sourc' | |||||
368 |
|
361 | |||
369 | if self.committeractions['dropcommitter']: |
|
362 | if self.committeractions['dropcommitter']: | |
370 | committer = None |
|
363 | committer = None | |
371 |
|
||||
372 | if self.committeractions['replacecommitter']: |
|
|||
373 | committer = author |
|
|||
374 | elif self.committeractions['replaceauthor']: |
|
364 | elif self.committeractions['replaceauthor']: | |
375 | author = committer |
|
365 | author = committer | |
376 |
|
366 |
@@ -491,12 +491,7 b' Various combinations of committeractions' | |||||
491 |
|
491 | |||
492 | $ hg --config convert.git.committeractions=dropcommitter,replaceauthor convert git-repo4 bad-committer |
|
492 | $ hg --config convert.git.committeractions=dropcommitter,replaceauthor convert git-repo4 bad-committer | |
493 | initializing destination bad-committer repository |
|
493 | initializing destination bad-committer repository | |
494 |
abort: committeractions cannot define both dropcommitter and replaceauthor |
|
494 | abort: committeractions cannot define both dropcommitter and replaceauthor | |
495 | [255] |
|
|||
496 |
|
||||
497 | $ hg --config convert.git.committeractions=dropcommitter,replacecommitter convert git-repo4 bad-committer |
|
|||
498 | initializing destination bad-committer repository |
|
|||
499 | abort: committeractions cannot define both dropcommitter and replaceauthor/replacecommitter |
|
|||
500 | [255] |
|
495 | [255] | |
501 |
|
496 | |||
502 | $ hg --config convert.git.committeractions=dropcommitter,messagealways convert git-repo4 bad-committer |
|
497 | $ hg --config convert.git.committeractions=dropcommitter,messagealways convert git-repo4 bad-committer | |
@@ -504,11 +499,6 b' Various combinations of committeractions' | |||||
504 | abort: committeractions cannot define both dropcommitter and messagealways |
|
499 | abort: committeractions cannot define both dropcommitter and messagealways | |
505 | [255] |
|
500 | [255] | |
506 |
|
501 | |||
507 | $ hg --config convert.git.committeractions=replaceauthor,replacecommitter convert git-repo4 bad-committer |
|
|||
508 | initializing destination bad-committer repository |
|
|||
509 | abort: committeractions cannot define both replaceauthor and replacecommitter |
|
|||
510 | [255] |
|
|||
511 |
|
||||
512 | custom prefix on messagedifferent works |
|
502 | custom prefix on messagedifferent works | |
513 |
|
503 | |||
514 | $ hg --config convert.git.committeractions=messagedifferent=different: convert git-repo4 git-repo4-hg-messagedifferentprefix |
|
504 | $ hg --config convert.git.committeractions=messagedifferent=different: convert git-repo4 git-repo4-hg-messagedifferentprefix | |
@@ -643,37 +633,6 b' replaceauthor replaces author with commi' | |||||
643 |
|
633 | |||
644 |
|
634 | |||
645 |
|
635 | |||
646 | replacecommitter replaces committer with author |
|
|||
647 |
|
||||
648 | $ hg --config convert.git.committeractions=replacecommitter convert git-repo4 git-repo4-hg-replacecommitter |
|
|||
649 | initializing destination git-repo4-hg-replacecommitter repository |
|
|||
650 | scanning source... |
|
|||
651 | sorting... |
|
|||
652 | converting... |
|
|||
653 | 1 addfoo |
|
|||
654 | 0 addfoo2 |
|
|||
655 | updating bookmarks |
|
|||
656 |
|
||||
657 | $ hg -R git-repo4-hg-replacecommitter log -v |
|
|||
658 | changeset: 1:190b2da396cc |
|
|||
659 | bookmark: master |
|
|||
660 | tag: tip |
|
|||
661 | user: nottest <test@example.org> |
|
|||
662 | date: Mon Jan 01 00:00:21 2007 +0000 |
|
|||
663 | files: foo |
|
|||
664 | description: |
|
|||
665 | addfoo2 |
|
|||
666 |
|
||||
667 |
|
||||
668 | changeset: 0:0735477b0224 |
|
|||
669 | user: test <test@example.org> |
|
|||
670 | date: Mon Jan 01 00:00:20 2007 +0000 |
|
|||
671 | files: foo |
|
|||
672 | description: |
|
|||
673 | addfoo |
|
|||
674 |
|
||||
675 |
|
||||
676 |
|
||||
677 | dropcommitter removes the committer |
|
636 | dropcommitter removes the committer | |
678 |
|
637 | |||
679 | $ hg --config convert.git.committeractions=dropcommitter convert git-repo4 git-repo4-hg-dropcommitter |
|
638 | $ hg --config convert.git.committeractions=dropcommitter convert git-repo4 git-repo4-hg-dropcommitter |
@@ -297,9 +297,6 b'' | |||||
297 | committer. Other actions that add references to the committer will |
|
297 | committer. Other actions that add references to the committer will | |
298 | still take effect when this is set. |
|
298 | still take effect when this is set. | |
299 |
|
299 | |||
300 | "replacecommitter" will replace the value of the committer field with |
|
|||
301 | the author. |
|
|||
302 |
|
||||
303 | The default is "messagedifferent". |
|
300 | The default is "messagedifferent". | |
304 |
|
301 | |||
305 | convert.git.extrakeys |
|
302 | convert.git.extrakeys |
General Comments 0
You need to be logged in to leave comments.
Login now