bjoernricks / python-quilt

A quilt implementation in python
MIT License
10 stars 3 forks source link

Avoid creating “.pc/” without “.version” in “new” operation #21

Closed vadmium closed 7 years ago

vadmium commented 7 years ago

The _pcdir.create() call was creating not only the subdirectory to hold original unpatched files, but also created the parent “.pc” directory if it didn’t exist. This was created without the “.version” file. Even though there was nothing in it, the original Quilt complains that the version is out of date.

I don’t understand why you created the empty _pcdir directory, but it seems safe to not create it, since you are removing it if it already existed.

bjoernricks commented 7 years ago

Just did a look at the behavior of quilt new and it is creating the .pc/ directory, .pc/applied-patches, .pc/.version, .pc/.quit_patches and .pc/.quilt_series files and I would like to follow the original quilt closely. But you are right about that this code path seems a bit immature.

vadmium commented 7 years ago

Quilt pushes the new patch so that it is applied, where as currently your version only creates it as an unapplied new patch. The other day I changed the CLI to match Quilt: https://github.com/bjoernricks/python-quilt/compare/master...vadmium:new/topmost. So far my change only affects the CLI, but not the quilt.new module.

bjoernricks commented 7 years ago

Thanks! I have used your proposed changes and integrated them into quilt/new.py directly in 89ed8ce97b6d11b797c282e3f47a23b68809d395

I am not sure if deleting the .pc/ is ok if it exists already but currently it is saver imho.

vadmium commented 7 years ago

That seems to work for me, thanks.