7 Commits

Author SHA1 Message Date
Sigurd Spieckermann
ef5ea4b212 refactor: rename internal modules with a _ prefix 2025-04-22 13:52:51 +02:00
Sigurd Spieckermann
b078959972 fix(updating): ignore last answer of when: false questions
A recorded answer may exist when the question's `when` value gets switched from `when: true` to `when: false`, e.g. when the value is templated or changes across Copier template versions.
2025-04-03 06:40:19 +02:00
Sigurd Spieckermann
ede686561d test: use helper function to load answers file data 2025-03-07 12:21:36 +01:00
Sigurd Spieckermann
b2f584d1a4 fix(updating): don't validate computed values 2024-10-21 19:29:35 +02:00
Sigurd Spieckermann
04dc88165f fix: parse new answer when --skip-answered is used 2024-09-21 06:55:04 +01:00
Jairo Llopis
afedd572c4 fix(recopy): never clone old template (even less if it's just for cleanup)
Before this patch, when doing a recopy for a subproject previously placed on a git ref that was no longer reachable, the recopy process still tried to clone the old template.

The funniest part is that it was only trying to clone it while doing the process of cleanup. Thus, even if that clone worked, it was a waste.

This should make recopy more resilient and performant.
2023-09-05 10:00:30 +01:00
Jairo Llopis
6996b9cc7a feat: add recopy command and function
This new command allows to reapply a template, keeping old answers but discarding subproject evolution.

It is useful when there are bugs replaying an old version of the template, or when the subproject has drifted too much from the template and you need to reset it.

BREAKING CHANGE: All CLI calls to Copier must now include the subcommand as the 1st argument. For example, `copier` must become now `copier update`; also `copier ./tpl ./dst` must become `copier copy ./tpl ./dst`.

BREAKING CHANGE: All flags must go after the subcommand now. For example, `copier -r HEAD update ./dst` must now become `copier update -r HEAD ./dst` or `copier update ./dst -r HEAD`.

BREAKING CHANGE: Automatic mode removed. Since now subcommands are required, the automatic mode is removed.

BREAKING CHANGE: Deprecated `copier.copy` function is removed. Use `copier.run_copy`, `copier.run_update` or `copier.run_recopy` explicitly as needed.

Fix https://github.com/copier-org/copier/issues/1081
Close https://github.com/copier-org/copier/issues/1082
2023-05-17 11:56:13 +01:00