Add Conduit method for querying user status

Summary:
I want to use this to warn user if he specifies reviewers that are away.

We can also implement a general query method but I think that this usage is the
most useful not only for me but also in general case.

Test Plan:
Call the method for user which is away and which is not away.
Add user status through Conduit.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D2492
Display user status on user profile

Test Plan:
Display users with:

- Title.
- Status.
- Title and status.

Also display project.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D2491
Highlight away and sporadic users in revision list

Summary:
This is not so general as `getRequiredHandlePHIDs()`.
It allows bulk loading of user statuses only in revision list.

It also loads data in `render()`. I'm not sure if it's OK.

Maybe we can use the colorful point here.
Or maybe some unicode symbol?

Test Plan: {F11451, size=full}

Reviewers: btrahan, epriestley

Reviewed By: btrahan

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2484
Move getPrimaryReviewer() to DifferentialRevision

Test Plan: Display revision list both with last reviewer and without.

Reviewers: epriestley, btrahan

Reviewed By: btrahan

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2495
Add Conduit method to disable user

Summary: There's no method for enabling users somewhat intentionally.

Test Plan: Disable myself (oops, this is probably my last diff ever).

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D2497
Phriction - fix error log spew from misconfigured table column classes

Summary: there were 6 values, but we only need 4. delete the two empty ones as the others are all stylistically valid.

Test Plan: ...looks good!

Reviewers: ric03uec, vrana, epriestley

Reviewed By: epriestley

CC: aran, epriestley

Maniphest Tasks: T1247

Differential Revision: https://secure.phabricator.com/D2498
Add a missing # in the markup.

Test Plan: (None)

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2499
Fix a typo.

Test Plan: (None.)

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2483
Integrate `user.getcurrentstatus` into `user.query`

Summary: D2492#6

Test Plan:
`user.query` of user which is away.
`user.query` of user which is not away.
`user.whoami` - no information there.

Reviewers: epriestley

Reviewed By: epriestley

CC: btrahan, aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2502
Highlight away status by bullet and display it everywhere

Summary: D2484#13

Test Plan:
Display revision list.
Display revision detail.

Reviewers: epriestley

Reviewed By: epriestley

CC: btrahan, aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2501
Update Conduit Maniphest CRUD API(s) to not accept crud

Summary: see T1241, T1242, T1244 for some examples of crud getting saved

Test Plan: threw some crud in my conduit console and got reasonable errors back

Reviewers: mikaaay, epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Maniphest Tasks: T1241, T1242, T1244

Differential Revision: https://secure.phabricator.com/D2487
Fix D2490 (make macro handler correctly bail if there are no macros)

Summary: D2490 was not my finest hour and I incorrectly thought it was a null value from error. In reality this error is impossible and its just a valid empty array so instead use the empty predicate to bail.

Test Plan: with our logic combined, this be tested

Reviewers: vrana, epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2503
fix a small bug from new profile status code stuff

Summary: we need a user (the viewer in this case) for the status to render correctly with respect to timezone

Test Plan: my profile no longer fatals with an away status

Reviewers: davidreuss, vrana

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D2504
Fix task + commit associating

Summary: we weren't actually removing any edges. now we do.

Test Plan: had a commit associated with task x; removed association. had a commit associated with task x; removed association while adding a different one.

Reviewers: floatinglomas, epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Maniphest Tasks: T1256

Differential Revision: https://secure.phabricator.com/D2509
Phriction - lock down /project/ wiki docs

Summary:
only show the blank, "create new" wiki page for the project if the project actually exists; only allow edit if the project actually exists.
Small wrinkle here is not checking if the project actually exists if the page already exists.

Test Plan:
- viewed a project wiki page
- viewed a prokect wiki page for a fake project and got a 404
- edited a project wiki page
- edited a project wiki page for a fake project and got a 404

Reviewers: epriestley, jacktrades

Reviewed By: epriestley

CC: aran, Koolvin

Maniphest Tasks: T1248

Differential Revision: https://secure.phabricator.com/D2506
Fix diffusion browse links in the owner's tool

Summary: ...they were broken...

Test Plan: clicked links for both SVN and Git repos and got working results

Reviewers: vrana, floatinglomas, 20after4

Reviewed By: floatinglomas

CC: aran, epriestley

Maniphest Tasks: T1250

Differential Revision: https://secure.phabricator.com/D2505
Make "Dnn" and "Tnn" match case-insensitively in the "attach" dialog

Summary: These patterns are hard-coded, allow them to match case-insenstiviely.

Test Plan: Typed "d3" and "D3", got the right object in the attach dialog.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1253

Differential Revision: https://secure.phabricator.com/D2511
Remove PHID database, add Harbormaster database

Summary:
  - We currently write every PHID we generate to a table. This was motivated by two concerns:
    - **Understanding Data**: At Facebook, the data was sometimes kind of a mess. You could look at a random user in the ID tool and see 9000 assocs with random binary data attached to them, pointing at a zillion other objects with no idea how any of it got there. I originally created this table to have a canonical source of truth about PHID basics, at least. In practice, our data model has been really tidy and consistent, and we don't use any of the auxiliary data in this table (or even write it). The handle abstraction is powerful and covers essentially all of the useful data in the app, and we have human-readable types in the keys. So I don't think we have a real need here, and this table isn't serving it if we do.
    - **Uniqueness**: With a unique key, we can be sure they're unique, even if we get astronomically unlucky and get a collision. But every table we use them in has a unique key anyway. So we actually get pretty much nothing here, except maybe some vague guarantee that we won't reallocate a key later if the original object is deleted. But it's hard to imagine any install will ever have a collision, given that the key space is 36^20 per object type.
  - We also currently use PHIDs and Users in tests sometimes. This is silly and can break (see D2461).
  - Drop the PHID database.
  - Introduce a "Harbormaster" database (the eventual CI tool, after Drydock).
  - Add a scratch table to the Harbormaster database for doing unit test meta-tests.
  - Now, PHID generation does no writes, and unit tests are isolated from the application.
  - @csilvers: This should slightly improve the performance of the large query-bound tail in D2457.

Test Plan: Ran unit tests. Ran storage upgrade.

Reviewers: btrahan, vrana, jungejason

Reviewed By: btrahan

CC: csilvers, aran, nh, edward

Differential Revision: https://secure.phabricator.com/D2466
Select default branches more effectively in Diffusion

Summary: If you have an empty value saved in the "default branch" field, we default to empty string (or null, or whatever) instead of the correct default.

Test Plan:
  - Looked at a Git repo with an empty default branch, got a default to "master" instead of an error.
  - Looked at a Mercurial repo with an empty default branch, got a default to "default" instead of an error.

Reviewers: btrahan, csilvers

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1237

Differential Revision: https://secure.phabricator.com/D2512
Increase result set to 100 from 25 for "attach" dialog

Summary: See T1254, until this gets paginated properly we can at least show more results. 25 is pretty anemic.

Test Plan: Tweaked limit, verified result count was affected.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1254

Differential Revision: https://secure.phabricator.com/D2513