tests: allow more flexibility in git diffstat output

The output of 'git diff --stat' changed in git 1.7.10 and 1.7.11.
To ensure the tests work with earlier versions of git as well,
the output is now wrapped with a whitespace regex.
spelling: fixes from proofreading of spell checker issues

--HG--
extra : amend_source : 27a321b2fce74751dc46175366b3759432c34d7d
merge: perform case-collision checking on final set of actions

When there are multiple common ancestors, we should check for case
collisions only on the resulting actions after bid merge has run. To
do this, move the code until after bid merge.

Move it past _resolvetrivial() too, since that might update
actions. If the remote changed a file and then reverted the change,
while the local side deleted the file and created a new file with a
name that case-folds like the old file, we should fail before this
patch but not after.

Although the changes to the actions caused by _forgetremoved() should
have no effect on case collisions, move it after that, too, so the
next person reading the code won't have to think about it.

Moving it past these blocks of code takes it to the end of
calculateupdates(), so let's even move it outside of the method, so we
also check collisions in actions produced by extensions overriding the
method.
hg.clone: set 'stream' depending on whether --pull was requested or not

In an upcoming patch we'll differentiate between the two in localrepo.
localrepo.clone: add a way to override server preferuncompressed

Without this patch, if the server sets preferuncompressed, there's no way for
clients to override that and force a non-streaming clone. With this patch, we
extend the meaning of --pull to also override preferuncompressed and force a
non-streaming clone.
debugindex: respect --debug flag to show full nodeids

--HG--
extra : amend_source : f2c6210366a9613b6bcc8f14759e25370755a5ee
share: implement shared bookmark functionality

This does not cause any behavioral change unless a 'bookmarks.shared' marker
file exists. A future change will add UI to create this file when a repository
is shared.
match: make 'always' and 'exact' functions, not classes

There is no reason for classes 'always' and 'exact' not to be just
functions that return instances the plain 'match' class.
subrepo: add revert support without backup for git subrepos

Previously, git subrepos did not support reverting.
This change adds basic support for reverting
when '--no-backup' is specified.
A warning is given (and the current state is kept)
when a revert is done without the '--no-backup' flag.

--HG--
extra : amend_source : a4c37c7c3070b64b888b1193f3afb78d0d3f2ec8
tests: avoid git diffstat singular/plural output difference

'git diff --stat' output changed with regard to the amount
of changes/insertions/deletions shown.
In older git versions (1.7.7.6), output was shown as:
2 files changed, 2 insertions(+), 1 deletions(-)
In newer versions, output is shown as:
2 files changed, 2 insertions(+), 1 deletion(-)

This patch uses a regex to handle both cases.

--HG--
extra : amend_source : 7d85651d769e44a992aef53c3a50520808515d69
statichttprepo: update profile of __call__ in mock vfs object

New code paths could fail because the old statichttprepo profile couldn't
handle the usual parameters.

Instead, reuse a more generic profile also used in readonlyvfs.
namespaces: introduce a generic way to map between names and nodes

This patch begins the work to provide a way to register a namespace to handle
'names'. Benefits of this would be,

- improved templating: This would provide {name} which could output any branch,
  bookmark, tag, or any extension registered namespace all without having the
  extension doing any extra work

- improved tab completion: Since this provides a single source of all 'names',
  tab completion would not need to know of each namespace

- changeset lookup: Similar to before, a unified place to get all 'names' will
  allow finding changesets without any extension code having to reimplement
  this

Also, d226fe36e362 has shown us that for internal code which expects a certain
type of method or behavior, we should provide an easy way for extensions to
check this behavior.

--HG--
extra : rebase_source : 2a8bd7568483d5f2c618dbcf0c6ff255582a6b17
namespaces: add a method to register new namespaces

--HG--
extra : rebase_source : eadb81038d585c21cfd834d8ebbfba9000bbf689
namespaces: add a function to turn single results into lists

--HG--
extra : rebase_source : 160290d9ce9c986c3e999994eed5307bda8ccc80
namespaces: pass repo to __init__

We store repo as a weakref so that we can prevent a cycle between namespaces
and localrepo.

--HG--
extra : rebase_source : 4d8ea60e9fcacf3ce38d8023460532fbf11ae254
namespaces: add a convenience property for the weakref _repo

--HG--
extra : rebase_source : e1d5080e5ac1795532a3c655554d9de566f4506f
namespaces: add bookmarks to the names data structure

This marks the first use of abstracting our different types of named objects
(bookmarks, tags, branches, etc.) and upcoming patches will use this to
simplify logic.

--HG--
extra : rebase_source : b189e822cf81b8201167d1e595c098fa837d24fe
namespaces: add a method to the first matching node for a given name

--HG--
extra : rebase_source : 3d9b271dbd3cfbeb940566a77cf582de24baa6af
changectx: use names api to simplify and extend node lookup

Previously, changectx had to know about each type of name (bookmark, tag, etc.)
to look up. Now, we use repo.namenodes to simplify (and extend) this.

--HG--
extra : rebase_source : 0c7ea92bf8c36f06df015ea62ec298e79a1e1b3c
namespaces: remove weakref; always pass in repo

It turns out that maintaining a reference of any sort (even weak!) to the repo
when constructed doesn't work because we may at some point pass in a repoview
filtered by something other than what the initial repo was.

--HG--
extra : rebase_source : 2def00d143fbcc131a79c974ad66ab5ae5f02e89