What do you mean by inside the zipped folder?foadsf wrote: ↑Sat Oct 12, 2019 11:10 amstart a git repository right inside the zipped folder
create a .gitignore file, or better to say a git white list, which makes sure only the two XML files GuiDocument.xml and Document.xml and ignore the rest
upon every save it automatically commits
the commit message could be extracted by parsing the git diff and listing all the changes made, plus other comments user could add
if one retrieves to an older commit then all the rest of the files could be deleted and recomputed.
well, the way Lei Zheng (aka RealThunder) is approaching the problem is to save everything inside a folder instead of a zipped file (reference). I'm not sure if exposing the internal guts of a .FCStd file to the users is such a good idea. It should be possible to treat the zip file as a folder in some way or another I think. And then do all git stuff right there without the need to unarchive.
It seems like you can. See this post for example. There I have reconstructed everything using just Document.xml.
Code: Select all
Traceback (most recent call last): File "<string>", line 66, in <module> File "<string>", line 51, in createDocument File "/usr/lib/python3.7/zipfile.py", line 1713, in write zinfo = ZipInfo.from_file(filename, arcname) File "/usr/lib/python3.7/zipfile.py", line 506, in from_file st = os.stat(filename) <class 'FileNotFoundError'>: [Errno 2] Datei oder Verzeichnis nicht gefunden: '/home/reox/CAD/tmp/PartShape.brp' Unhandled Base::Exception caught in GUIApplication::notify. The error message is: [Errno 2] Datei oder Verzeichnis nicht gefunden: '/home/reox/CAD/tmp/PartShape.brp'