Add Z-index to notifications

Summary:
Currently, notifications aren't z-indexed so they can end up underneath some other elements:

{F13144}

Fix this so they float correctly.

Test Plan: {F13166}

Reviewers: jungejason, btrahan

Reviewed By: jungejason

CC: aran

Maniphest Tasks: T1398

Differential Revision: https://secure.phabricator.com/D2834
Send several X-Differential-CC headers

Summary: People want to create filters checking if they are in CC which is almost impossible with multiplexing in Outlook.

Test Plan: Sent e-mail with multiple CCs, verified headers.

Reviewers: epriestley, nh

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2829
Allow overriding translations without creating PhabricatorTranslation

Test Plan: Overridden '%d Detail(s)', verified that it was used.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1139

Differential Revision: https://secure.phabricator.com/D2815
Link revision from blame

Summary: I need this much more than commit but it can be useful too.

Test Plan: Displayed blame, clicked on the link.

Reviewers: epriestley

Reviewed By: epriestley

CC: john, aran, Korvin, phunt

Differential Revision: https://secure.phabricator.com/D2820
Mark date and time format translatable

Summary:
This allows translations to specify custom date and time format.
We will need to call `setlocale()` or build system independent on it at some point but I guess it is good for now.

Test Plan: Translated 'D, M j, g:i A', saw it in diff.

Reviewers: btrahan, epriestley

Reviewed By: btrahan

CC: aran, Korvin

Maniphest Tasks: T1139, T1321

Differential Revision: https://secure.phabricator.com/D2809
Destroy changeset parse cache when destroying a revision

Summary: When we delete a DifferentialChangeset, also delete the cache if it exists.

Test Plan:
Destroyed a revision, verified cache was destroyed. See marked line below.

        $ ./scripts/differential/destroy_revision.php D1 --trace
        >>> [0] <connect>
        <<< [0] <connect> 1,324 us
        >>> [1] <query> SELECT * FROM `differential_revision` WHERE `id` = 1
        <<< [1] <query> 517 us

            Really destroy 'D1: asdb' forever? [y/N] y

        >>> [2] <connect>
        <<< [2] <connect> 633 us
        >>> [3] <query> START TRANSACTION
        <<< [3] <query> 183 us
        >>> [4] <query> SELECT * FROM `differential_diff` WHERE revisionID = 1
        <<< [4] <query> 560 us
        >>> [5] <query> SAVEPOINT Aphront_Savepoint_1
        <<< [5] <query> 197 us
        >>> [6] <query> SELECT * FROM `differential_changeset` WHERE diffID = 3
        <<< [6] <query> 672 us
        >>> [7] <query> SAVEPOINT Aphront_Savepoint_2
        <<< [7] <query> 188 us
        >>> [8] <query> SELECT * FROM `differential_hunk` WHERE changesetID = 6
        <<< [8] <query> 946 us
        >>> [9] <query> DELETE FROM `differential_hunk` WHERE `id` = 6
        <<< [9] <query> 335 us
  ****  >>> [10] <query> DELETE FROM `differential_changeset_parse_cache` WHERE id = 6
        <<< [10] <query> 1,464 us
        >>> [11] <query> DELETE FROM `differential_changeset` WHERE `id` = 6
        <<< [11] <query> 313 us
        >>> [12] <query> SAVEPOINT Aphront_Savepoint_2
        <<< [12] <query> 151 us
        >>> [13] <query> SELECT * FROM `differential_hunk` WHERE changesetID = 7
        <<< [13] <query> 226 us
        >>> [14] <query> DELETE FROM `differential_hunk` WHERE `id` = 7
        <<< [14] <query> 164 us
        >>> [15] <query> DELETE FROM `differential_changeset_parse_cache` WHERE id = 7
        <<< [15] <query> 318 us
        >>> [16] <query> DELETE FROM `differential_changeset` WHERE `id` = 7
        <<< [16] <query> 189 us
        >>> [17] <query> SELECT * FROM `differential_diffproperty` WHERE diffID = 3
        <<< [17] <query> 500 us
        >>> [18] <query> DELETE FROM `differential_diffproperty` WHERE `id` = 1
        <<< [18] <query> 179 us
        >>> [19] <query> DELETE FROM `differential_diff` WHERE `id` = 3
        <<< [19] <query> 211 us
        >>> [20] <query> DELETE FROM `differential_relationship` WHERE revisionID = 1
        <<< [20] <query> 391 us
        >>> [21] <query> DELETE FROM `differential_commit` WHERE revisionID = 1
        <<< [21] <query> 397 us
        >>> [22] <query> SELECT * FROM `differential_comment` WHERE revisionID = 1
        <<< [22] <query> 448 us
        >>> [23] <query> DELETE FROM `differential_comment` WHERE `id` = 1
        <<< [23] <query> 212 us
        >>> [24] <query> DELETE FROM `differential_comment` WHERE `id` = 2
        <<< [24] <query> 160 us
        >>> [25] <query> SELECT * FROM `differential_inlinecomment` WHERE revisionID = 1
        <<< [25] <query> 549 us
        >>> [26] <query> SELECT * FROM `differential_auxiliaryfield` WHERE revisionPHID = 'PHID-DREV-orsh7alzcj764ubv2f34'
        <<< [26] <query> 531 us
        >>> [27] <query> SELECT * FROM `differential_affectedpath` WHERE revisionID = 1
        <<< [27] <query> 5,676 us
        >>> [28] <query> DELETE FROM `differential_revision` WHERE `id` = 1
        <<< [28] <query> 442 us
        >>> [29] <query> COMMIT
        <<< [29] <query> 324 us
        OK, destroyed revision.

Reviewers: csilvers, btrahan

Reviewed By: csilvers

CC: aran

Differential Revision: https://secure.phabricator.com/D2835
handle svn and hg for auto-close

Summary: in svn and hg (for now), no branch used.

Test Plan: will test live

Reviewers: epriestley

CC: nh, vrana, aran, Korvin

Differential Revision: https://secure.phabricator.com/D2839
Display revision number in history

Test Plan:
Displayed repository.
Displayed repository history.
Wondered that we actually have bunch of commits without a revision.
Displayed blame.
Didn't display merge commit.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2840
Don't treat links to redyoutube.com as YouTube

Test Plan: `http://redyoutube.com/?v=1`

Reviewers: tuomaspelkonen, epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D2842
Provide a Conduit method to get inline comments

Summary:
See D2855 for usage.

This has a drawback that inlines without a comment (synthetic comments) are not attached anywhere.
I don't like adding more and more methods so I've chosen this solution.
Plus comments and inline comments are often useful together.

Test Plan: Called the method on a revision with inline comments.

Reviewers: epriestley

Reviewed By: epriestley

CC: vii, aran, Korvin

Differential Revision: https://secure.phabricator.com/D2844
Fix auto-close in a repo with missing commits in Phabricator db

Summary:
After adding more error logging: https://secure.phabricator.com/differential/diff/5295/, discover.php prints the output: https://secure.phabricator.com/P427

The problem is that there are gaps in the commits and revisions in Phabricator's DB for the repo. For some git commits, both the phabricator commits and the differential revision are missing (because of a mysterious DB data loss. nharper should be able to recover it); for some other git commits, the phabricator commits are missing (probably also because of the daba loss mentioned above). This can also happen if the git commits were too big to be parsed by phabricator.

Because of the gap, the pull daemon detects them as new autoclose commits on the branch
  (https://secure.phabricator.com/diffusion/P/browse/master/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php;382bafa271ec4962$267)
  (https://secure.phabricator.com/diffusion/P/browse/master/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php;382bafa271ec4962$592)

Then tries to update it
  (https://secure.phabricator.com/diffusion/P/browse/master/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php;382bafa271ec4962$616)
and will fail because the commit doesn't exist in the DB.
  (https://secure.phabricator.com/diffusion/P/browse/master/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php;382bafa271ec4962$341)
After the exception is thrown, all the commits just detected are not marked as 'seenOnBranches', so they won't be marked as closed by the CommitMessageParserWorker.

This also explains the weird behavior where the parsing of the commits is always paused for 15 minutes and then gets started again. The parsing pauses because the process listed at https://secure.phabricator.com/P427 takes quite some time to finish before it can record tha tasks. The parsing happens all the time because the process will be executed again and again.

A better fix might be to put all the missing commits in the repository_badcommit table and check against it.

Test Plan: will run 'discover.php FBCODE' to test it.

Reviewers: epriestley, vrana

Reviewed By: vrana

CC: nh, vrana, aran, Korvin

Differential Revision: https://secure.phabricator.com/D2846
Add vebose logging to PhutilRepositoryPullDaemon

Summary: Add verbose logging. This logging is activated by setting "phd.verbose" in the config, running "phd debug", or explicitly in scripts/repository/pull.php and scripst/repository/discover.php

Test Plan:
  >>> orbital ~/devtools/phabricator $ ./scripts/repository/discover.php GTEST
  Discovering 'GTEST'...
  <VERB> PhabricatorRepositoryPullLocalDaemon Discovering commits in repository 'GTEST'...
  <VERB> PhabricatorRepositoryPullLocalDaemon Examining branch '()_+abcd$100', at a37bc285a12efa7224fe19f3df54cd90fa2b897a.
  <VERB> PhabricatorRepositoryPullLocalDaemon Skipping, HEAD is known.
  <VERB> PhabricatorRepositoryPullLocalDaemon Examining branch '+abcd$100', at a37bc285a12efa7224fe19f3df54cd90fa2b897a.
  <VERB> PhabricatorRepositoryPullLocalDaemon Skipping, HEAD is known.
  <VERB> PhabricatorRepositoryPullLocalDaemon Examining branch '_+abcd$100', at a37bc285a12efa7224fe19f3df54cd90fa2b897a.
  <VERB> PhabricatorRepositoryPullLocalDaemon Skipping, HEAD is known.
  <VERB> PhabricatorRepositoryPullLocalDaemon Examining branch 'abcd$100', at a37bc285a12efa7224fe19f3df54cd90fa2b897a.
  <VERB> PhabricatorRepositoryPullLocalDaemon Skipping, HEAD is known.
  <VERB> PhabricatorRepositoryPullLocalDaemon Examining branch 'arcpatch', at 774c7737b2d560a291697126bf4513204ccf661a.
  <VERB> PhabricatorRepositoryPullLocalDaemon Skipping, HEAD is known.
  <VERB> PhabricatorRepositoryPullLocalDaemon Examining branch 'arcpatch-1', at dc97539bee07293f95990d71f4638335a2531d69.
  <VERB> PhabricatorRepositoryPullLocalDaemon Skipping, HEAD is known.
  <VERB> PhabricatorRepositoryPullLocalDaemon Examining branch 'arcpatch-2', at 1acfaec313c46dd3caa90448800181fb91b0270f.

Reviewers: jungejason

Reviewed By: jungejason

CC: aran

Differential Revision: https://secure.phabricator.com/D2843
Minor, fix XSS in task description change notifications.
Extract ldap auth from password auth completely
T1354 : Resize profile pics (specifically to handle github v3 api)

Reviewed by: epriestley
GitHub Pull: https://github.com/facebook/phabricator/pull/140
Introduce "bin/repository" for repository management

Summary:
Nothing new or exciting here yet, just moving the random scripts/repositories/ things to bin/repository. Also add `repository list`.

(Console stuff comes from D2841.)

Test Plan: Ran `repository list`, `repository pull`, `repository discover`, `repository discover --verbose`, `repository help`.

Reviewers: jungejason, vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D2849
Add a --repair flag to "bin/repository discover"

Summary:
If a repository is missing commits because they mysteriously vanished, there's no reasonable way to get them back right now. Provide a way to ignore the state in the database and rediscover the entire repository unconditionally.

We don't queue any reparses or anything, but when I move reparse into this script we can hook things up or something. This generally shouldn't be too important anyway.

Test Plan: Ran `repository discover --repair` on Phabricator.

Reviewers: jungejason, nh, vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D2850
Use subprocess output streaming to improve performance of Git commit discovery

Summary:
Improve performance of large discovery tasks in Git by using subprocess streaming, like we do for Mercurial.

Basically, we save the cost of running many `git log` commands by running one big `git log` command but only parsing as much of it as we need to. This is pretty complicated, but we more or less need it for mercurial (which has ~100ms of 'hg' overhead instead of ~5ms of 'git' overhead) so we're already committed to most of the complexity costs. The git implementation is much simpler than the hg implementation because we don't need to handle all the weird parent rules (git gives us to them easily).

Test Plan:
Before, `discover --repair` on Phabricator took 35s:

  real	0m35.324s
  user	0m13.364s
  sys	0m21.088s

Now 7s:

  real	0m7.236s
  user	0m2.436s
  sys	0m3.444s

Note that most of the time is spent inserting rows after discover, the actual speedup of the git discovery part is much larger (subjectively, it runs in less than a second now, from ~28 seconds before).

Also ran discover/pull on single new commits in normal cases to verify that nothing broke in the common case.

Reviewers: jungejason, nh, vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1401

Differential Revision: https://secure.phabricator.com/D2851
WIP
Fixing upload_max_filesize configuration directive