1c-partial-cf skill
A skill that builds a small CF file with only the chosen objects from a 1C export so compare and merge open in seconds
- 28 ★ on the repository
- Last commit
Extended access
Why this level
- The script runs `ibcmd` and writes CF files and merge settings to disk.
- If objects are chosen wrongly, the `/MergeCfg` settings file can overwrite extra things in the database, so merge on a copy first.
Install
- Works in
- Services
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/1c-partial-cfDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The script runs `ibcmd` and writes CF files and merge settings to disk.
- If objects are chosen wrongly, the `/MergeCfg` settings file can overwrite extra things in the database, so merge on a copy first.
This is third-party code. Review the repository files before installing.
What it does
The `partial_cf.py` script takes a Designer XML export and builds a CF where the chosen objects are included whole with their forms, modules and templates and keep their original UUIDs. Objects referenced by the chosen objects' metadata come in as stubs with the same UUID, while the root and the `_Перенос` subsystem are rebuilt. A stubs list and a `/MergeCfg` settings file are written next to it: chosen objects are taken from the file and stubs do not change the database. Objects are given as a list through `--objects` or taken from git through `--since`. To carry only your own module edits, `--patch` and `--methods` apply changes as a patch to the modules of the target database export. The skill does not change the database; a person merges in Designer or in batch mode on an explicit command.
Who it is for. 1C developers who edit a configuration in an XML export and move changes into a database without loading the whole configuration
Good fit when
- You fixed a few objects in the export and want the transfer into the database to open in seconds.
- Only your own methods should move from a common module, leaving other people's changes alone.
- A task's commits need to be gathered into a CF for merging with the target database.
- The compare-and-merge window takes too long to build on the full configuration.
Not a fit when
- You need a full CF build, a CFE extension, an external data processor or a CFU update file.
- The machine has no 1C platform with `ibcmd`: a CF cannot be built without it.
- You need to delete an object in the database: a CF does not carry deletions, so do it by hand.
Example request
Build a small CF from the export with only the Document.РеализацияТоваровУслуг and the Catalog.НоменклатураLimitations
You need Python 3.8 or newer with the standard library only, the 1C platform with `ibcmd`, and git if objects are selected with `--since`. Export files must be saved on disk. Patch transfer has been verified only with batch `/MergeCfg`, and if the database changed after the `--target` export, the merge refuses as a whole. Objects are picked at the top level: an attribute or a form cannot be chosen separately. A CF does not carry object deletions.
How to disable. Delete the `1c-partial-cf` directory from the skills directory. Remove the built CF files and `.merge-settings.xml` by hand.
FAQ
How do I choose objects for the CF?
By list with `--objects`, for example `Document.РеализацияТоваровУслуг Catalog.Номенклатура`, or from git with `--since HEAD`, which takes objects changed since a revision and new ones.
What are stubs in the CF?
Objects referenced by the chosen ones: they have the same UUID but no modules, and the merge settings keep them from changing the database.
Can I carry only a module change?
Yes, `--patch` and `--methods` apply a patch to the modules of the target database export passed through `--target`.
Which Python and platform versions are needed?
Python 3.8 or newer with the standard library only, and the 1C platform with `ibcmd`. The script runs on Windows and Linux.
What does the skill do to my database?
It leaves the database alone. A person starts the merge in Designer or in batch mode on an explicit command.
Discussion
No questions or reviews yet.
Related
All 1C:Enterprise toolsA skill that moves a customized standard 1C configuration to a new vendor release through a three-way git merge
1c-enterprise-skill: developing 1C configurations from XML and BSL
1c-enterprise-skill
A skill with a linter and templates: an agent creates and edits 1C 8.3 configurations in XML and BSL sources without manual entry in the Configurator
A skill for 1C platform batch operations: build and unpack data processors, load and dump configurations and extensions, launch the base
Skills covering the full 1C:Enterprise 8.3 development cycle, from XML sources to publishing and web client testing
A 1C development skill collection for Codex and Claude Code: XML sources, forms, data composition, infobases, web publishing and an HTTP test bridge
A large set of skills, rules and commands that let an agent build and parse 1C sources in the platform's format, without the Designer
README in short
The README explains what goes into the CF: objects, stubs, the root and the `_Перенос` subsystem. It then covers object selection, carrying only module changes and environment requirements.
README badge
Original SKILL.md
--- name: 1c-partial-cf description: Маленькая CF из выгрузки конфигурации 1С (XML конфигуратора) только с нужными объектами и их исходными UUID — для быстрого «Сравнить, объединить с конфигурацией из файла» или пакетного /MergeCfg. Используй, когда пользователь поправил или добавил объекты в выгрузке и хочет перенести их в базу, просит «собрать маленькую CF», «CF для объединения», «перенести изменения выгрузки в базу», «перенести только свои изменения модуля или метода, не затрагивая чужие». Не используй для полной сборки CF, расширений (CFE), внешних обработок и файлов обновления поставки (CFU). --- # 1c-partial-cf Скрипт `scripts/partial_cf.py` рядом с этим файлом собирает CF, в которой: - **выбранные объекты** — целиком (формы, модули, макеты, справка) с исходными UUID; - **заглушки** — объекты, на которые ссылаются метаданные выбранных (типы реквизитов, регистры движений, владельцы, определяемые типы, картинки, стили и команды форм, таблицы и поля запросов динамических списков — с вложенными запросами и временными таблицами, `ОБЪЕДИНИТЬ`, `ВЫБОР`/`ВЫРАЗИТЬ`, ресурсами виртуальных таблиц, `.Ссылка.`/`.Регистратор.`/`.Владелец.`, общими реквизитами, — `ЗНАЧЕНИЕ()` в запросах модулей, колонки таблиц и деревьев значений формы, набор констант): тот же UUID и сгенерированные типы, а из состава — только то, на что ссылаются, и без чего платформа не загрузит объект; - **корень** — тот же UUID, имя, языки и режим совместимости; - **подсистема `_Перенос`** — в составе только выбранные объекты. Рядом с CF скрипт пишет `<имя>.merge-settings.xml` — настройки `/MergeCfg`: выбранные объекты берутся из файла; корень и `_Перенос` — `DoNotMerge`, заглушки — `MergePrioritizingMainConfiguration` (приоритет базы), а их модули, модули сохраненных команд и форм и урезанный состав функциональной опции — `DoNotMerge`: модулей заглушки в CF нет. Так заглушка базу не меняет — проверено сравнением выгрузки базы до и после `/MergeCfg` (8.3.27), в том числе когда модули базы отличаются от выгрузки. Без явного правила платформа объединяет и неперечисленное: корень терял `Ext/ClientApplicationInterface.xml`, заглушка затирала объект в базе, модуль заглушки добавлял в базу методы и перевод строки; заглушки с `DoNotMerge` большая конфигурация отвергает как «неразрешимые ссылки». **Перенос только своих изменений модулей (`--patch`).** С `--since` объект, у которого изменены только модули (объекта, менеджера, набора записей, общего модуля, формы, команды), переносится не целиком, а патчем каждого измененного модуля: в настройках у модуля `Patch` (unidiff), остальное в объекте — от базы, неизмененные формы, команды и макеты — `DoNotMerge`. Изменения задачи — от `--since` до `--until` (без него — рабочее дерево); задача из нескольких коммитов среди чужих — ее коммиты подряд или отдельная ветка. Объект, где изменено что-то кроме модулей, или новый объект идет целиком (`patched_whole`). - `--target <выгрузка базы>` — выгрузка базы-получателя (полная или `ibcmd infobase config export objects`): изменения задачи накладываются на ее модули (`git merge-file`), правки базы сохраняются. Пересечение с правками базы (в том числе соседние строки) — отказ до сборки: `conflicts`, файлы с маркерами `<<<<<<< база` / `>>>>>>> задача` — в `conflicts_folder`. Без `--target` патч строится на модуле как в `--since`: если в базе эти строки или их окружение изменены, `/MergeCfg` откажет («Методы, к которым не применились изменения: …») и не изменит ничего. - `--methods` — только изменения этих методов (`--patch` включается сам): `CommonModule.Модуль.Метод`, `Document.Д.ObjectModule.Метод` (также `ManagerModule`, `RecordSetModule`, `ValueManagerModule`), `Document.Д.Form.Форма.Метод`, `Document.Д.Command.Команда.Метод`, `CommonForm.Форма.Метод`, `CommonCommand.Команда.Метод`. Метод — заголовок, тело и комментарии и директивы прямо над ним; прочие изменения не переносятся (`patch_skipped`). - Патч применяется строго: если база изменилась после выгрузки для `--target`, `/MergeCfg` откажет целиком. Перенос патчами проверен только пакетным `/MergeCfg`. Нужны Python 3.8+ (только стандартная библиотека), платформа 1С с `ibcmd` и, для `--since`, git. Работает в Windows и Linux: `ibcmd` ищется в `Program Files\1cv8\<версия>\bin` и `/opt/1cv8/<арх>/<версия>`. ## Что выяснить у пользователя - Каталог выгрузки (там лежит `Configuration.xml`). - Какие объекты переносить: - `--objects` — `Вид.Имя` верхнего уровня на английском: `Document.РеализацияТоваровУслуг`, `Catalog.Номенклатура`, `CommonModule.ОбщегоНазначения`. Реквизит или форма не выбираются — только объект целиком; - или `--since <ревизия git>` — объекты, файлы которых изменены с ревизии, и новые неотслеживаемые. Для незакоммиченной правки — `--since HEAD`. Можно и то и другое сразу. - Переносить объекты целиком или только изменения модулей (`--patch`, `--methods`); если только изменения — есть ли выгрузка базы-получателя для `--target`. - Путь к CF (`--out`). - Версию платформы, если их несколько и нужна конкретная (`--platform 8.3.27`); иначе берется самая новая. Путь к `ibcmd` можно задать явно (`--ibcmd`). ## Запуск ``` python <каталог скилла>/scripts/partial_cf.py --export <выгрузка> --out <файл.cf> --since HEAD python <каталог скилла>/scripts/partial_cf.py --export <выгрузка> --out <файл.cf> --objects Document.А Catalog.Б python <каталог скилла>/scripts/partial_cf.py --export <выгрузка> --out <файл.cf> --since <начало задачи> --until <конец задачи> --patch --target <выгрузка базы> python <каталог скилла>/scripts/partial_cf.py --export <выгрузка> --out <файл.cf> --since HEAD --target <выгрузка базы> --methods CommonModule.ОбщегоНазначения.Метод ``` В Windows при необходимости `py -3` вместо `python`; в Linux — `python3`. Файлы выгрузки должны быть сохранены на диск. Отбор объектов занимает секунды (крупный документ с сотнями заглушек — до минуты), упаковка в CF через `ibcmd` — до минуты; давай команде 10 минут.