comparison hgext/evolve.py @ 1296:23819e1d61fd stable

evolve: add -i flag to amend command The -i flag was missing because it is not a global flag of the commit command. We can't make it a global flag yet as it is used in many places where it would not be appropriate so we just add it for this occurrence. Also, we only want to add it when commit supports it (otherwise it wouldn't work with older versions of mercurial)
author Laurent Charignon <lcharignon@fb.com>
date Thu, 23 Apr 2015 17:45:46 -0700
parents 891c3ce894fa
children 765286e47619 14587fbcba93
comparison
equal deleted inserted replaced
1289:12d5c9eaa86d 1296:23819e1d61fd
84 def memfilectx(repo, *args, **kwargs): 84 def memfilectx(repo, *args, **kwargs):
85 return oldmemfilectx(*args, **kwargs) 85 return oldmemfilectx(*args, **kwargs)
86 else: 86 else:
87 raise ImportError('evolve needs version %s or above' % min(testedwith.split())) 87 raise ImportError('evolve needs version %s or above' % min(testedwith.split()))
88 88
89 89 aliases, entry = cmdutil.findcmd('commit', commands.table)
90 hasinteractivemode = util.any(['interactive' in e for e in entry[1]])
91 if hasinteractivemode:
92 interactiveopt = [['i', 'interactive', None, _('use interactive mode')]]
93 else:
94 interactiveopt = []
90 # This extension contains the following code 95 # This extension contains the following code
91 # 96 #
92 # - Extension Helper code 97 # - Extension Helper code
93 # - Obsolescence cache 98 # - Obsolescence cache
94 # - ... 99 # - ...
1828 _('mark new/missing files as added/removed before committing')), 1833 _('mark new/missing files as added/removed before committing')),
1829 ('e', 'edit', False, _('invoke editor on commit messages')), 1834 ('e', 'edit', False, _('invoke editor on commit messages')),
1830 ('', 'close-branch', None, 1835 ('', 'close-branch', None,
1831 _('mark a branch as closed, hiding it from the branch list')), 1836 _('mark a branch as closed, hiding it from the branch list')),
1832 ('s', 'secret', None, _('use the secret phase for committing')), 1837 ('s', 'secret', None, _('use the secret phase for committing')),
1833 ] + walkopts + commitopts + commitopts2 + commitopts3, 1838 ] + walkopts + commitopts + commitopts2 + commitopts3 + interactiveopt,
1834 _('[OPTION]... [FILE]...')) 1839 _('[OPTION]... [FILE]...'))
1835 def amend(ui, repo, *pats, **opts): 1840 def amend(ui, repo, *pats, **opts):
1836 """combine a changeset with updates and replace it with a new one 1841 """combine a changeset with updates and replace it with a new one
1837 1842
1838 Commits a new changeset incorporating both the changes to the given files 1843 Commits a new changeset incorporating both the changes to the given files