Add section headers in "Contributing to Gerrit" documentation

Split the opening paragraphs of the page into "Introduction",
"Contributor License Agreement" and "Code Review" sections.

This reduces the "wall of text" feel of the first part of the page.

Change-Id: Iefebfd978345aced606856bcd7b856bc10cb371a
Improve formatting on "Contributing to Gerrit" page

- Use backticks around code, commands, and file names.

- Use single quotes instead of double quotes when referring to
menu names.

- Use hyperlinks rather than bare http:// links

- Refer to "topics" rather than "topic branches".

- Fix a couple of typos.

Change-Id: Ic279a7bbe3459cfa36886a24d2c8cbfc809d9048
Fix indentation level of "Review Criteria" sections of contributor doc

The "Review Criteria" has several sub sections, but they are all on
the same level. Increase the indentation so that they are listed as
sub sections of "Review Criteria" in the table of contents.

Change-Id: I67efaaf13697fa39fc4e11ca56001420dad9e739
Add a checklist of updates needed when upgrading GWT

We recently updated GWT to 2.7.0 and a few things got missed.

Add a checklist to prevent it from happening again.

Change-Id: I3af7db2dbd0174391c301df3096731bfb1d3d802
ChangeScreen2: Hide topic link and edit icon while editing

Instead of showing the old topic above the new topic:

  Topic     inline-fixes                          [edit]
            [ inline-fixes ]
            Update                               Cancel

Hide the topic link and edit icon while the edit box is
visible on screen. This allows the input field to occupy
the same visual region the text is usually in.

Change-Id: I4cefadfd4fd2db9779798b715c6df540860a62d6
Remove the idea of "release" vs. "developer" schema versions

When prototyping the secondary index during the Boulder hackathon of
June 2013, we originally came up with this idea that certain secondary
index schema versions could not be removed because they were part of a
release, while others could. This idea never really panned out; we
never created even a single developer schema.

Kill that distinction in the code.

Change-Id: I0fd9d4e129a31e444cb2ed6aba2aa75105ba7706
Delete ChangeSchemas versions older than V11

V11 is the schema version in Gerrit 2.10. The next version of Gerrit
needs to be able to live upgrade from V11, so it needs to have the
code to support this version. However, we are not committed to
providing live upgrades from arbitrarily old versions of Gerrit. Users
for whom live upgrades are absolutely necessary must upgrade one
version at a time; the only other alternative is an offline reindex.

In theory we could also delete the schema versions between V11 and
V14. That was the kind of idea we were getting at by separating into
release/developer schemas, but we have not done the necessary
bookkeeping. Those intermediate schemas will die in 2.12 anyway, so
killing them sooner is not worth the effort.

Change-Id: I63849f3b7eb02bcc5d9fa236fcd4ac3a7ffede56
Remove all references to deleted change fields

We had lots of hard-coded logic to do slightly different things
depending on which version of a particular field was present in a
schema. For every field that has now been completely removed, we can
remove references including these bits of extra logic.

The difference is especially striking in the sortkey query path. Note
that queries containing sortkeys have already been failing since
servers upgraded to schema version 8 (2.9), which no longer uses this
field.

Change-Id: Ib1fbc9f3aa45bf068b7869ca3aada40dbe4cb1bb
Fix inline edits working on root commits

The initial commit of a repository should be mutable through
inline edits. Fix up the inline edit code to finish removing
all assumptions about "edit is commit on top of patch set".
This allows the code to just amend the commit and safely work
with 0 parents.

When restoring a path from the initial commit, treat that
as a file deletion. The file does not exist. Undoing create
would be deleting it.

When restoring a path edited during a merge commit, revert
to the version from parent 0. This is an "ours" type of merge
on that path, and is likely what the caller wants.

When restoring a path that doesn't exist in the ancestor,
the delete the path. This is very similar to the restore on
an initial commit. The path didn't exist before this change.

Change-Id: Ibab826f48575c0fdff09e4d3d0939e1f01c3baac
Don't create a new commit when creating an edit

The first step to make an edit just needs to establish the ref.
There is no need to immediately amend the commit with the caller
as committer. After creating the edit ref another operation will
happen to record a new message or a new file contents, and that
will write out a new (amended) commit object for the caller.

Change-Id: I7b51e813ece58ecdbc6e75e0e19b49a25f513247
Record "inline edit (amend)" as the reflog message for edits

Edits are being modified over time. Its may be useful to have
the reflog history reflecting prior states. Include a useful
log message text denoting these are all inline edits amending
the commit.

Change-Id: I08742b250354e6f03918418a1bbef641e7c95e80
Add hasEmailAddress to IdentifiedUser

This allows validation code to pass in an email address
for checking, and lets IdentifiedUser worry about how
that occurs.

This refactoring opens the door to delegating the check
to backend systems that are not able to supply the entire
valid email list for a user.

Change-Id: I3db2b34d311d0c8f6f5c0cfdaa109d44fd79e264
Merge changes from topic 'kill-sortkey'

* changes:
  Remove all references to deleted change fields
  Delete ChangeSchemas versions older than V11
  Remove the idea of "release" vs. "developer" schema versions
Merge changes from topic 'developer-documentation-improvements'

* changes:
  Add a checklist of updates needed when upgrading GWT
  Fix indentation level of "Review Criteria" sections of contributor doc
  Improve formatting on "Contributing to Gerrit" page
  Add section headers in "Contributing to Gerrit" documentation
Permit Realm to supply email address verification on the fly

A Realm might have more data about a user's account in the backend
database. If email address information is available, the realm could
look this up on the fly to verify incoming commits.

Add a new hasEmailAddress() method to check individual emails and
cache results inside of the IdentifiedUser object for the duration
of the current request/operation scope.

Also add a method to lookup as many possible email variations as
possible, for reporting in error messages or GET /emails API.

Change-Id: I13fec7eb00b1bd6ddcb74323ba7205ee1b2ee42f
Optimize PermissionCollection to delay listing emails

The email addresses are only necessary if a ref pattern
containing ${username} pertains to an access request made
by the caller.

If patterns are not user-specific (e.g. refs/heads/*),
it is safe to skip loading emails from the AccountState
and Realm objects.

Change-Id: Id801dd637f69f1983bf28268654923099933817a
Merge changes from topic 'realm-email'

* changes:
  Optimize PermissionCollection to delay listing emails
  Permit Realm to supply email address verification on the fly