run-tests: do not fail on empty tsttest file

Initialize n for not failing on empty tsttest files.
bookmark: don't allow integers as bookmark/branch/tag names

Bookmarks/branches/tags shouldn't be allowed to be integers because that
overlaps with revision numbers.  Right now if a user created one they can't
use it anyway because the revision numbers take precedence.

The check only happens when creating a new bookmark/etc from a command so it
shouldn't affect existing bookmarks/branches/tags or importing branches from
git.

This fix was prompted by us having a user create a bookmark named "404" then
accidentally checkout a very old version of our repository.
dirstate: move pure python dirstate packing to pure/parsers.py
incoming: fix incoming when a local head is remotely filtered (issue3805)

In its current state discovery may return (remotely) filtered elements
in "common". This has usually no impact as "missing" is kept clear of
filtered elements. However when the "remote" repo is a local repo (disk
accessible, and directly created in memory) the incoming code takes a
shortcut and directly uses the "remote" repo to generate the incoming
output. When some common elements are filtered this led to a crash. We
now ensure we use an unfiltered repository to generate the incoming
output. This does not change the behavior as missing is clear of
filtered revision.

Now that we have proper low level filtering, incoming code needs a
deeper cleanup but it is already planned.

--HG--
branch : stable
extra : rebase_source : 386828df2e047ee07f322293f766744ac82b2626
extra : amend_source : bf44d8eb7440a3dd7de83de6668a4cb81354d999
merge with stable
convert/git: catch errors from modern git-ls-remote (issue3428)

Since git v1.7.8.2-327-g926f1dd (the change was first released in git
1.7.10), git does not return non-zero when "git ls-remote --tags ..."
is run and the repository is damaged. This causes the "damaged
repository with missing commit" test in test-convert-git.t to
unexpectedly succeed.

Fix by aborting if git outputs any lines beginning with "error:",
which required adding some subprocess use in convert/git.py.

--HG--
extra : rebase_source : dd0813966ca6bccef645eeaf52d6da72bb0a7fae
test-convert-git: stabilize corruption of test git repo

This error would show up only intermittently since the
test depended on the order of the directories returned by os.walk.

The damage repository test would delete the first object file it came
across. However, the order of the directory listing is arbitrary (it
seems to depend on the filesystem). This meant that sometimes a commit
object was deleted, sometimes a blob object and sometimes a tree
object.

So, fix by hardcoding which object to delete. Delete a commit object,
a blob object and a tree object in three separate tests.

--HG--
extra : rebase_source : c535bf55ded941f06e151b46b9c503683ef9157e
git convert: some versions of git use fatal: instead of error:

I saw this behavior with git 1.7.12 on my Mac.

--HG--
extra : rebase_source : 308ca2cf35e358d8882e372910c8e9a42fc5c59a
largefiles: fold oddly named _verify into remotestore.exists
largefiles: docstrings for verify methods