bookmarks: fix divergent bookmark path normalization

--HG--
extra : rebase_source : 3154d903d1e28083c3bad3896c8e1e7448a79411
largefiles: remove 'forget' list that's always empty

--HG--
extra : rebase_source : 47013e15dd7654ffa3d7e9fd8c38623821799c65
hgk: define bookmark colour explicitly, as Tk 8.6 has changed their meaning

--HG--
extra : rebase_source : d110bb88e8fa926360796701a87657bdf6f7b6af
util: move _hgexecutable a few lines, closer to where it is used

--HG--
extra : rebase_source : 1c57612b3d45267154842dbb77e47d1795cb7606
util: introduce datapath for getting the location of supporting data files

templates, help and locale data is normally stored as sub folders in the
directory containing the source of the mercurial module. In a frozen build they
live as sub folders next to 'hg.exe' and 'library.zip'.

These different kind of data were handled in different ways. Unify that by
introducing util.datapath. The value is computed from the environment and is
always used, so we just calculate the value on module load.

--HG--
extra : rebase_source : 88c30f9d283e46335150e0932a6c9a371e47edd6
templater: introduce templatepaths for getting paths searched for templates

Avoid function with different return types depending on parameters.

--HG--
extra : rebase_source : f63f6ee605d148f39ce2dd651e42c0c52c9e86ba
templater: inline global 'path' list in templatepaths

--HG--
extra : rebase_source : ae510a8f409cba057fa58cc3159b2d04694b0dbb
templater: don't search randomly for templates - trust util.datapath

The search was introduced in 2653740d8118. It might have been necessary back
then when using __file__ directly and frozen-ness wasn't considered. Now we
should know exactly where the templates can be found.

--HG--
extra : rebase_source : 35b156ba3c0209017edb6558d55098e91e5fa99c
help: don't search randomly for help data - trust util.datapath

The search was introduced in c904e76e3834 without a convincing explanation why
it should be necessary ... except for consistency with templater handling.

Now, just keep it simple.

--HG--
extra : rebase_source : f82ea82b0962bb691496c936c43cb58d6c278fb4
i18n: use datapath for i18n like for templates and help

To avoid circular module dependencies we initialize i18n from util when
datapath is found.

--HG--
extra : rebase_source : 3a52bc22c6e08c491913fdf765c26e8928631794
branches: reduce nesting in for loop

--HG--
extra : rebase_source : 1a86baf722b58c4111e5e56c0e6857644a610330
setup: set mode 644 or 755 on installed files

--HG--
extra : rebase_source : 038c8223eb9a5e0e28bbf33de0ecdfee7b6fefb9
pull: use `other.url()` as the source of a bookmark pull

We want to move the bookmarks movement into `exchange.pull`, for this purpose we
need to stop relying on variables from `command.pull`.

--HG--
extra : rebase_source : a3e46315d3865a8dd1f0c94a7a5e7788a6a0a7d5
localrepo: pass arbitrary kwargs from `repo.pull` to `exchange.pull`

We'll add bookmark-related arguments to `repo.pull` so we need to widen the
signature of `repo.pull`. We should probably kill `repo.pull` now that
`repo.push` is dead but this is outside the scope of this series.

--HG--
extra : rebase_source : e73296f8cabaadb17530b3040cfcda6cefd76f58
util: fix sorteddict.pop

When using `.pop` on such object the list was not cleared of the popped key,
leading to crash.

--HG--
extra : rebase_source : ee8bab9f55c183a5f69f6773406162e558b57a5c
bookmarks: allow `updatefromremote` to be quiet

This will be useful to use the function during clone (clone is not printing any
bookmark data right now)

--HG--
extra : rebase_source : 0b9c4d24d8977bd7327a247bd3743d444028074e
pull: move bookmark movements inside the `exchange.pull`

There is no reason for bookmarks to get a special treatment. As a first step we
move the code as is in the `exchange.pull` function. Integration with the rest
of the flow will come later.

Adding bookmarks to pull means that most clone paths are now pulling bookmarks
through pull. We ensure that bookmark-update messages are properly suppressed in
that case.

In test-pull-http.t the 'requesting all changes' message disappear because we
now get the authentication error on the `listkeys`command before such message
is printed.

--HG--
extra : rebase_source : 3f260d54b5d897d2dd684c0e276593df22c18208
clone: copy `.hg/bookmarks` during copy clone

Now that the standard pull function includes bookmarks, we need to ensure that
a copy clone also copies the bookmarks. This will let us drop the manual bookmark
pulling done independently during a clone.

--HG--
extra : rebase_source : 6bdd461f0bea41b85fecb6cd70e43345833f7962
clone: explicitly push bookmarks when cloning from local to remote

We need to explicitly push all local bookmarks when doing the clone from a local
repo to a remote one through ssh. This will let us remove the manual export of
bookmarks in clone and rely on the official exchange in push and pull instead.

--HG--
extra : rebase_source : 5b2f931f650e362231d5a472b9ffda109f8aaa79
clone: remove duplicated bookmark pulling

Now that all clone methods (copy, pull and push) also transport bookmarks, we can
safely drop the manual pulling that was performed during clone.

--HG--
extra : rebase_source : 623fce3f9e2708dc644b9990e779d1e9bdd15459