Comment Added stream event should be fired even if mail is not sent

If a reviewer adds a comment and unchecks the "and send email" option,
no email is sent, but the "comment-added" event is also not fired on
the events stream.

Fix it so the "comment-added" event is always sent, even if the "send
email" option is disabled.

Change-Id: I31cb740e99614585ce29b3a3bf4c6e2432db9c16
Guard against diff.mnemonicprefix in commit-msg hook

When the '[diff] mnemonicprefix' configuration is enabled, and changes
are committed with "git commit -v", the diff included in the commit
message starts with "diff --git c/" instead of "diff --git a/", causing
the commit-msg hook to keep the diff in the message it produces.

Change-Id: Icbe9cf55305d432fca2875357f289685d6c51c87
Set uploader to current user in "patchset-created" event upon rebasing

When rebasing a change through the Web-UI (both old and new
ChangeScreen), the corresponding patchset-created event had its
patchSet.uploader set to the Change's owner instead of the current
user. We now set it to the current user, so stream-events consumers
can properly detect who uploaded the rebased patch set.

Bug: Issue 2493
Change-Id: Iea9459c7015cde9e869dad5946bd1d3b2db5d51a
Fix submit rule evaluation for non blocking labels

Putting a negative score on a label configured as `NoBlock` causes
the submit button to be disabled.  However, a `NoBlock` label is
supposed to be purely informational and its values not considered
when determining whether a change is submittable.

Fix the submit rule evaluation to prevent the button from being
disabled.

Also add an integration test.

Bug: Issue 2453
Change-Id: I0825b3c2d4774c17d523ac5f7890b983fa07af39
Fix incompatibility between "Rebase if Necessary" and "copy*Score*"

There was a bug when :
  - a project is set up with "Rebase if Necessary"
  - one of its labels has copyAllScoresOnTrivialRebase (or copyMaxScore)
  - a change that actually needs a trivial rebase is submitted
Gerrit first rebases, and in the process copies the approval for the label,
then it copies all the approvals, including the one already copied, which
results in a constraint violation on the database.

Fix by using upsert instead of insert (duplicates are identical anyway).

Change-Id: Iadccfa581cf273028a9b9b6065b6d1071842d27f