discovery: pass pushop to _nowarnheads
Previously, we passed only enough information to _nowarnheads to perform the old
calculation. However, extensions may want to use more information in this
calculation. Now that pushop is extensible, extensions will often want access
to the additional fields they have added to the pushop, so pass that through.
Specifically, the remotenames extension will use this information to allow
pushing new heads that are bookmarked without requiring --force.
exchange: pass pushop to discovery.checkheads
Previously, we passed a bunch of parameters to discovery.checkheads, but all
of the arguments can be fetched out of pushop, which may contain a lot more
useful information for extensions now that pushop is extensible.
share: wrap bmstore._writerepo for transaction sensitivity (
issue4940)
46dec89fe888 made 'bmstore.write()' transaction sensitive, to restore
original bookmarks correctly at failure of a transaction.
For example, shelve and unshelve imply steps below:
before
46dec89fe888:
1. move active bookmark forward at internal rebasing
2. 'bmstore.write()' writes updated ones into .hg/bookmarks
3. rollback transaction to remove internal commits
4. restore updated bookmarks manually
after
46dec89fe888:
1. move active bookmark forward at internal rebasing
2. 'bmstore.write()' doesn't write updated ones into .hg/bookmarks
(these are written into .hg/bookmarks.pending, if external hook
is spawn)
3. rollback transaction to remove internal commits
4. .hg/bookmarks should be clean, because it isn't changed while
transaction running: see (2) above
But if shelve or unshelve is executed in the repository created with
"shared bookmarks" ("hg share -B"), this doesn't work as expected,
because:
- share extension makes 'bmstore.write()' write updated bookmarks
into .hg/bookmarks of shared source repository regardless of
transaction activity, and
- intentional transaction failure at the end of shelve/unshelve
doesn't restore already updated .hg/bookmarks of shared source
This patch makes share extension wrap 'bmstore._writerepo()' instead
of 'bmstore.write()', because the former is used to actually write
bookmark changes out.
test: use generaldelta in 'test-clonebundle.t'
Using generaldelta has effects on the generated bundle.
test: use generaldelta in 'test-ssh.t'
This has effects on the capabilities string.