mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
ab3a7cb21f
Summary: In preparation for merging fb-mercurial sources to the Eden repository, move everything from the top-level directory into an `eden/scm` subdirectory.
34 lines
921 B
Python
34 lines
921 B
Python
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
#
|
|
# This software may be used and distributed according to the terms of the
|
|
# GNU General Public License version 2.
|
|
|
|
"""replace terms with more widely used equivalents
|
|
|
|
With this extension enabled, some terms will be replaced by their more
|
|
well-known equivalents. Namely, "changeset" will be replaced by "commit".
|
|
"""
|
|
|
|
testedwith = "ships-with-fb-hgext"
|
|
|
|
from edenscm.mercurial import extensions, i18n
|
|
|
|
|
|
def _ugettext(orig, message):
|
|
if orig:
|
|
message = orig(message)
|
|
message = message.replace("changeset", "commit")
|
|
return message
|
|
|
|
|
|
def _ungettext(orig, singular, plural, count):
|
|
if orig:
|
|
message = orig(singular, plural, count)
|
|
message = message.replace("changeset", "commit")
|
|
return message
|
|
|
|
|
|
def uisetup(ui):
|
|
extensions.wrapfunction(i18n, "_ugettext", _ugettext)
|
|
extensions.wrapfunction(i18n, "_ungettext", _ungettext)
|