merge with crew-stable
test-dirstate: remove test with date larger than 32 bit

When running on a 32bit system or with a touch command that only accepts
32bit dates, the following happened:
$ touch -t 250001011200 a
touch: invalid date format `250001011200'
spelling: fix minor spell checker issues
run-tests: drop unused enumerate
branchcache: fetch source branchcache during clone (issue3378)

Recomputing branch cache on clone may be expensive,
therefore if possible we fetch it along with the data.

- If the clone is performed by copying, we just copy branchcache file.
- If we localrepo.clone and streaming then we follow the procedure:
  1. Fetch branchmap from the remote
  2. Fetch the actual data.
  3. Find the latest rev within branch heads (tip at the time of
     branchmap fetch)
  4. Update the cache for the revs in [remotetip+1, tip]

This way we ensure that the branchcache is correct even in case
of races with commits.

--HG--
extra : rebase_source : c49cbe58dc89863d17cd3606256f4469a6f1e6dd
run-tests: use more explicit criteria for detecting no-eol

Preparing for the situation where there could be unsalted lines not terminated
with \n.

--HG--
extra : rebase_source : 8c74563ba9bc11c0419483656e12439afe136666
run-tests: allow test output lines to be terminated with \r in addition to \n

str.splitlines could not be used in 546c76e5a3e6, but _now_ we would like to
have lines with other line endings than \n.

Some fine occurences of (esc) markup of \r is replaced with multiple lines
ending with '\r (no-eol) (esc)'.  That is no win but also no significant loss.

This change makes it possible to drop filtercr.py - _that_ is a win.

--HG--
extra : rebase_source : d5aa81edaad713c782abf1271ee416a981c877b4
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup

--HG--
extra : rebase_source : 3d4ea89662e6d184b23a7af27aed9d97e5965e3e
store: add a contains method to basicstore

Adds a __contains__ method to basicstore that checks if a file/dir is present in the store

--HG--
extra : rebase_source : 8ad4e0a0401d5e0da67b9964e778869affd3d245
store: add a contains method to fncachestore

Adds a __contains__ method to fncachestore to check for file/dir existence (using fncache.__contains__).
Also extends fncache.__contains__ to check for directories (by prefix matching)

--HG--
extra : rebase_source : f02cdf073fd3a5cff18f055aca337721f38ccb7e
log: speed up hg log for untracked files (issue1340)

'hg log' on untracked files tends to be fairly slow. The root cause is that we end up using the 'slowpath' when we can't find a revlog for the files listed. This could happen if the file in question is an untracked file, or it is a directory.
This diff tries to speed up 'hg log' (by avoiding the slowpath) for files if we can determine if that file is not (and was never) a directory. We use the previously added store.__contains__ methods to test if the directory exists (or existed) in the store.
To avoid changing any existing semantics, this 'optimization' kicks in only when none of the files listed as arguments to the hg log command exist in the store.

--HG--
extra : rebase_source : 35b2834ee2c56b672e04911114918d6d58f41be5
store: invoke "osutil.listdir()" via vfs

This patch invokes "osutil.listdir()" via vfs object.

The function added newly to "abstractvfs" is named not as "listdir()"
but as "readdir()", because:

  - "os.listdir()" seems to be more familiar as "listdir()" than
    "osutil.listdir()"

  - "osutil.listdir()" returns also type of each files like
    "readdir()" POSIX API: even though "d_type" field of "dirent"
    structure is defined mainly only on BSD/Linux

This patch invokes "osutil.listdir()" via "rawvfs" object to avoid
filename encoding, because the path passed to "osutil.listdir()"
shouldn't be encoded.

This patch also omits importing "osutil" module, because it is no
longer used.

--HG--
extra : rebase_source : ec214c50d822714ac565a3f199aa5dee25af72bb
tests: correctly report a test killed by a signal
vfs: use fchmod for _fixfilemode

On general principle, we should use fchmod instead of chmod to avoid
security pitfalls, although none is likely possible here.

--HG--
extra : rebase_source : afbfc9d2e7ee6b4a3539e6fc08c61617edf31467
revsets: add branchpoint() function

The branchpoint() function returns changesets with more than one child.
Eventually I would like to be able to see only branch points and merge
points in a graphical log to see the topology of the repository.

--HG--
extra : rebase_source : 40f8079538a0f8527bae9537e2496910fd248cd7
notify: support revset selection for subscriptions

A repo pattern for any notify configuration contains a glob matching the
path to the repo. Additionally, it may now contain a revset spec, separated
from the glob by '#'.

Example:
  [reposubs]
  */widgets#branch(release) = qa-team@example.com

This sends to ``qa-team@example.com`` whenever a changeset on the ``release``
branch triggers a notification in any repository ending in ``widgets``.

This patch was completely done by David Champion <dgc@uchicago.edu> with me
making tiny changes to his tests.

--HG--
extra : rebase_source : 0bfa9a839bdf50ca07dbeefd7bbc1443943e54ae
templatefilters: avoid traceback caused by bogus date input (issue3344)

Wrap datefilters which split date texts with util.parsedate.

We do not abort, as the bogus date must have been given by the user.

--HG--
extra : rebase_source : abb90fd8c91c0c85adf37ee03b6ae68379193db3
clone: update to @ bookmark if it exists

--HG--
extra : rebase_source : 3f875dbb2f5f261901ec58a3de563fe547dc390b
templatekw: add parent1, parent1node, parent2, parent2node keywords

The {parents} template is cumbersome for some uses, as it does not show
anything if there's only one "natural" parent and you can't use it to get the
full 40 digit node hashes for parents unless you rely on the behavior of
the --debug flag.

Introduce four new template keywords: {parent1}, {parent2}, {parent1node} and
{parent2node}. The "node" flavors of these always show full 40 digit hashes,
but users can get the short version with a filter construction like
'{parent1node|short}'.
Merge with crew-stable