hg: establish function for performing post-share actions
As part of writing an extension that wished to share an arbitrary piece
of data among shared repos, I had to reimplement a significant part of
hg.share in order to obtain localrepository instances for the source
and destination.
This patch establishes a function in hg.py that will be called after a
share is performed. It is passed localrepository instances so extensions
can easily perform additional actions at share time. We move hgrc and
shared file writing there because this function is a logical place for
it.
A side effect of the refactor is writing of the shared file now occurs
before updating. This seems more appropriate and shouldn't have any
impact on real world behavior.
share: pass named arguments
They are defined as named arguments and previous called as positional
arguments. As part of wrapping hg.share in an extension, I had to
extract arguments using some hacky techniques. Using named arguments
makes wrapping much simpler.
commandserver: cut import cycle by itself
We generally make modules importable from the front-end layer, dispatch ->
commands -> x. So the import cycle to dispatch should be resolved by the
commandserver module.
tests: relax histedit
issue4251 and
issue3893 backups
I'm globbing these because some are globbed, and this pair
gets in the way of the main parts of the series.
setup.py: use bytes literals
The b() helper was needed because Python < 2.6 didn't support bytes
literals (b''). Now that we don't support Python < 2.6, we no longer
need this helper.
merge: rework manifestmerge to use a matcher
This opens the door to working slightly more closely with the manifest
type and letting it optimize out some of the diff comparisons for us,
and also makes life significantly easier for narrowhg.