glandium / git-cinnabar

git remote helper to interact with mercurial repositories
GNU General Public License v2.0
288 stars 61 forks source link

git push --atomic #334

Open riastradh opened 4 hours ago

riastradh commented 4 hours ago
$ git push --atomic origin c882229d437b3afd2f2d5f1d9a5b1f6bfc04b10e:refs/heads/branches/default/tip
fatal: helper hg does not support --atomic

(Of course, with only one ref update that doesn't matter, but if there are multiple ref updates it might.)

Does this require support on the hg server side, or only on the cinnabar client side?

glandium commented 2 hours ago

If you push several things as remote heads (not bookmarks), then pushes are already atomic, even if the --atomic option is not supported. For bookmarks, the story is different. The bookmarks are not updated atomically at the moment, and I'm not sure whether doing a batch update would be atomic. If not, maybe update via bundlev2 would work, but I'm not sure either. For a mix of bookmarks and heads, only the latter might work. All of those are cinnabar side, assuming the mercurial side does the right thing.