You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The action create file_1.txt should not be printed because file_1.txt was removed in the project.
An action indicating the removal of file_2.txt is missing because file_2.txt was removed in the template.
Specifically, the output should be this:
$ copier update dst
Updating to template version 2
Copying from template version 2
identical .
- create file_1.txt+ remove file_2.txt
conflict .copier-answers.yml
overwrite .copier-answers.yml
Screenshots/screencasts/logs
No response
Operating system
Linux
Operating system distribution and version
Ubuntu 20.04
Copier version
8.1.0
Python version
CPython 3.9
Installation method
pipx+pypi
Additional context
I think there's no easy fix with the current update algorithm implementation. It might be necessary to extend the copy and update implementations to comprise 2 stages:
@yajo just to clarify and understand. Is it normal that in the current stable version when I run a copier update I don't see any detailed output of what's happening?
It would also appear that an update will blindly overwrite diverged files without warning and when I say overwrite I mean discard changes introduced in the destination path, is that currently intended or a bug? If the latter, would you like me to open an issue for it? Scrap that it seems to work now.
Is it normal that in the current stable version when I run a copier update I don't see any detailed output of what's happening?
Yes. Since detecting the changes is hard, I removed the report. After all, only git-tracked repos can be updated, so you can use your favorite git diff tool to review the changes.
Describe the problem
When updating a project that involves removed files in the template or the project, the actions printed to the terminal aren't correct.
Template
See reproducible example below.
To Reproduce
Logs
No response
Expected behavior
There should be two changes in the output:
create file_1.txt
should not be printed becausefile_1.txt
was removed in the project.file_2.txt
is missing becausefile_2.txt
was removed in the template.Specifically, the output should be this:
Screenshots/screencasts/logs
No response
Operating system
Linux
Operating system distribution and version
Ubuntu 20.04
Copier version
8.1.0
Python version
CPython 3.9
Installation method
pipx+pypi
Additional context
I think there's no easy fix with the current update algorithm implementation. It might be necessary to extend the copy and update implementations to comprise 2 stages:
Then, the update plan would be constructed by getting the copy plan and modifying it. For instance, in this example the
_remove_old_files()
function would add an actionremove file_2.txt
and some analysis of the changes incurred by applying the diff of the user changes on top of the project generated from the old template version would remove the actioncreate file_1.txt
from the plan.This certainly needs some careful thinking and extensive testing to get right.
The text was updated successfully, but these errors were encountered: