tests/fakemergerecord.py
author Jun Wu <quark@fb.com>
Wed, 23 Nov 2016 18:13:11 +0000
changeset 30544 3899c358b45a
parent 29766 b303b3817d0e
child 32376 46ba2cdda476
permissions -rw-r--r--
crecord: filter text via i18n There are some text in the user interface that are not filtered by i18n. This patch adds the missing "_" call. So the text could be translated.

# Extension to write out fake unsupported records into the merge state
#
#

from __future__ import absolute_import

from mercurial import (
    cmdutil,
    merge,
)

cmdtable = {}
command = cmdutil.command(cmdtable)

@command('fakemergerecord',
         [('X', 'mandatory', None, 'add a fake mandatory record'),
          ('x', 'advisory', None, 'add a fake advisory record')], '')
def fakemergerecord(ui, repo, *pats, **opts):
    with repo.wlock():
        ms = merge.mergestate.read(repo)
        records = ms._makerecords()
        if opts.get('mandatory'):
            records.append(('X', 'mandatory record'))
        if opts.get('advisory'):
            records.append(('x', 'advisory record'))
        ms._writerecords(records)