But this bloats revision history of the articles. I sometime do have more then 100 attachments. I like to have version 1.x for all new migrated articles.
So by doing that, basically you perform a new save for each new attachment.
For having what you want, basically you would need to create the page with all the attachments at once. Frankly I’m not sure it’s currently possible, but you could test creating the page with
with a PUT with an XML content containing all your attachments, it might be feasible.
Now be aware that until very recently it wasn’t possible to even create a page and add attachments without performing multiple saves in XWiki UI, so I wouldn’t be surprised if it doesn’t work (see: Loading...).
Don’t hesitate to create a ticket on https://jira.xwiki.org if you test it and that doesn’t work.