hg import [ПАРАМЕТР]... ПАТЧ...
псевдонимы: patch
импортировать упорядоченный набор патчей
Import a list of patches and commit them individually (unless
--no-commit is specified).
To read a patch from standard input (stdin), use "-" as the patch
name. If a URL is specified, the patch will be downloaded from
there.
Import first applies changes to the working directory (unless
--bypass is specified), import will abort if there are outstanding
changes.
Use --bypass to apply and commit patches directly to the
repository, without affecting the working directory. Without
--exact, patches will be applied on top of the working directory
parent revision.
You can import a patch straight from a mail message. Even patches
as attachments work (to use the body part, it must have type
text/plain or text/x-patch). From and Subject headers of email
message are used as default committer and commit message. All
text/plain body parts before first diff are added to the commit
message.
If the imported patch was generated by :hg:`export`, user and
description from patch override values from message headers and
body. Values given on command line with -m/--message and -u/--user
override these.
If --exact is specified, import will set the working directory to
the parent of each patch before applying it, and will abort if the
resulting changeset has a different ID than the one recorded in
the patch. This will guard against various ways that portable
patch formats and mail systems might fail to transfer Mercurial
data or metadata. See :hg:`bundle` for lossless transmission.
Use --partial to ensure a changeset will be created from the patch
even if some hunks fail to apply. Hunks that fail to apply will be
written to a <target-file>.rej file. Conflicts can then be resolved
by hand before :hg:`commit --amend` is run to update the created
changeset. This flag exists to let people import patches that
partially apply without losing the associated metadata (author,
date, description, ...).
.. note::
When no hunks apply cleanly, :hg:`import --partial` will create
an empty changeset, importing only the patch metadata.
With -s/--similarity, hg will attempt to discover renames and
copies in the patch in the same way as :hg:`addremove`.
It is possible to use external patch programs to perform the patch
by setting the ``ui.patch`` configuration option. For the default
internal tool, the fuzz can also be configured via ``patch.fuzz``.
See :hg:`help config` for more information about configuration
files and how to use these options.
See :hg:`help dates` for a list of formats valid for -d/--date.
.. container:: verbose
Examples:
- import a traditional patch from a website and detect renames::
hg import -s 80 http://example.com/bugfix.patch
- import a changeset from an hgweb server::
hg import https://www.mercurial-scm.org/repo/hg/rev/5ca8c111e9aa
- import all the patches in an Unix-style mbox::
hg import incoming-patches.mbox
- import patches from stdin::
hg import -
- attempt to exactly restore an exported changeset (not always
possible)::
hg import --exact proposed-fix.patch
- use an external tool to apply a patch which is too fuzzy for
the default internal tool.
hg import --config ui.patch="patch --merge" fuzzy.patch
- change the default fuzzing from 2 to a less strict 7
hg import --config ui.fuzz=7 fuzz.patch
Returns 0 on success, 1 on partial success (see --partial).
options:
== ====================== ========================================================================================================
-p --strip КОЛ-ВО настройка strip для каталога при применении патча. Значит то же, что и в команде patch (по умолчанию: 1)
-b --base ПУТЬ базовый путь (УСТАРЕЛО)
--secret использовать секретную фазу для фиксации
-e --edit вызвать редактор для создания сообщения фиксации
-f --force не проверять наличие назафиксированных изменений (УСТАРЕЛО)
--no-commit не фиксировать, просто обновить рабочий каталог
--bypass применить файл, не трогая рабочий каталог
--partial фиксировать, даже при ошибках в некоторых лоскутах (hunks)
--exact abort if patch would apply lossily
--prefix КАТАЛОГ apply patch to subdirectory
--import-branch использовать любую информацию о ветках из патча (подразумевается при --exact)
-m --message ТЕКСТ текст сообщения фиксации
-l --logfile ФАЙЛ взять сообщение фиксации из файла
-d --date ДАТА использовать эту дату в качестве даты фиксации
-u --user ПОЛЬЗОВАТЕЛЬ использовать этого пользователя как автора фиксации
-s --similarity ПОХОЖЕСТЬ считать файлы переименованными исходя из степени их похожести (от 0 до 100)
== ====================== ========================================================================================================
global options ([+] can be repeated):
== ====================== =======================================================================================================================
-R --repository ХРАНИЛИЩЕ корневой каталог хранилища или имя файла комплекта
--cwd КАТАЛОГ сменить рабочий каталог
-y --noninteractive не спрашивать, на все вопросы автоматически выбирать первый вариант
-q --quiet подавлять вывод
-v --verbose включить дополнительный вывод
--color ТИП when to colorize (boolean, always, auto, never, or debug)
--config КОНФИГ [+] задать/переопределить параметр конфигурации (в виде 'секция.параметр=значение')
--config-file HGRC [+] load config file to set/override config options
--debug включить отладочный вывод
--debugger запустить отладчик
--encoding КОДИРОВКА установить кодировку (по умолчанию: UTF-8)
--encodingmode РЕЖИМ установить режим кодировки (по умолчанию: strict)
--traceback всегда печатать трассировку стека при исключении
--time время выполнения команды
--profile профилирование выполнения команды
--version напечатать информацию о версии и выйти
-h --help показать справку и выйти
--hidden учитывать скрытые наборы изменений
--pager ТИП когда использовать прокрутку (логический. always (всегда), auto(автоматически) или never (никогда) (по умолчанию: auto)
== ====================== =======================================================================================================================