Fixing upload_max_filesize configuration directive
Merge pull request #143 from dzhibas/exception-error-fix

Exception configuration directive fix (php.ini) upload_max_filesize
Minor, allow feed stories to publish with no related PHIDs (commits, future notifications).
Robustify profile image controls ever so slightly

Summary: show project profile image on pertinent edit page. also add a "Use Default Image" checkbox for both project and user profiles. Also added a function for projects to get the profile picture to prevent some copy + paste action.

Test Plan: set my user profile and project profile image. clicked "Use Default Image" and got the default image back.

Reviewers: epriestley, floatinglomas

Reviewed By: floatinglomas

CC: aran, Korvin

Maniphest Tasks: T1307

Differential Revision: https://secure.phabricator.com/D2852
Return attached hashes from `differential.query`

Summary: See T693. To do "arc branch" performantly in immutable history repositories, we need to be able to do a single query to identify revisions related by hash. Return hash information to enable this.

Test Plan: Ran `differential.query`.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T693

Differential Revision: https://secure.phabricator.com/D2859
Inform user about associated accounts in failed login

Summary:
Sometimes people create their account in Phabricator using some OAuth provider, forget about it and then tries to login with another provider.

Provide this information to them.

Test Plan: Tried to link an account linked to already existing user.

Reviewers: epriestley

Reviewed By: epriestley

CC: robarnold, aran, Korvin

Differential Revision: https://secure.phabricator.com/D2857
Remove leading "/" so that "git cat-file" works

Summary:
When the absolute path is used for load file (loadFileContent(()), it fails in git. For example:

  /var/repo/page_admin_app
  > git cat-file blob '4d6c03923006d6c444660f2c734fe03e10fd20bd':'/ios/PageAdminApp/Resources/splash/De           fault-Portrait@2x~ipad.png'
  fatal: Not a valid object name 4d6c03923006d6c444660f2c734fe03e10fd20bd:/ios/PageAdminApp/Resources/s           plash/Default-Portrait@2x~ipad.png

This is breaking the auto-closing for about 8 revisions like

https://phabricator.fb.com/rPPA4d6c03923006d6c444660f2c734fe03e10fd20bd ...
https://phabricatorcator.fb.com/rPPA51acb7e482aab0c491b530ed19dddc741d50f673 ...

Test Plan:
- reparsed https://phabricator.fb.com/rPPA4d6c03923006d6c444660f2c734fe03e10fd20bd successfully with corresponding differential revision being closed.

- verified that without leading '/', loadFileContent for svn still works. Both of the following commands worked (note the double '/' right before 'tfb':

  svn cat svn+ssh://svn.vip.facebook.com/svnroot//tfb/trunk/www/flib/intern/cachearchiver/regenerators/wurfl/CacheArchiveWurflRegenerator.php@579700
  svn cat svn+ssh://svn.vip.facebook.com/svnroot/tfb/trunk/www/flib/intern/cachearchiver/regenerators/wurfl/CacheArchiveWurflRegenerator.php@579700

Reviewers: vrana

Reviewed By: vrana

CC: nh, aran, epriestley

Differential Revision: https://secure.phabricator.com/D2847
Document arc:exec

Summary: docs

Test Plan: Generated / read docs.

Reviewers: dschleimer

Reviewed By: dschleimer

CC: aran, phleet

Maniphest Tasks: T1233

Differential Revision: https://secure.phabricator.com/D2831
Use a format that's support by both zend php and hphp

Summary:
hphp doesn't support "24:00". Use "23:59:59 instead. This is causing the stat page only shows the '1 week' stat.

in hphp

  hphpd> =strtotime('1 week ago')
  1340143086
  hphpd> =strtotime('1 week ago 24:00')

  hphpd> =strtotime('1 week ago 23:59:59')
  1340175599

in zend php

  jungejasonmbp15:tmp jungejason$ cat timeformat.php
  <?php

  echo strtotime('1 week ago 24:00');
  echo "\n";
  echo strtotime('1 week ago 23:59:59');
  echo "\n";
  echo strtotime('1 week ago 24:00') - strtotime('1 week ago 23:59:59');;
  echo "\n";
  jungejasonmbp15:tmp jungejason$ php -f timeformat.php
  1340175600
  1340175599
  1

Test Plan: viewed the stat page.

Reviewers: vrana, epriestley

Reviewed By: epriestley

CC: nh, aran, epriestley

Differential Revision: https://secure.phabricator.com/D2865
Use whole days in Differential stats

Test Plan: /differential/stats/revisions/

Reviewers: vii, jungejason, epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D2867
Mark text output in docs
Prevent Firebug from crashing in Firefox 13 / Window 7

Summary:
Simpler fix for D2572. Not entirely sure why Firebug is crashing Firefox. It appears to be callstack depth related, possibly? You can sort of reproduce this like this:

  >>> var f = function(n) { n && f(n - 1); }
  >>> f(10000); // Takes a few ms to run.
  >>> f(40000); // Takes a few ms to run.
  >>> f(50000); // Hangs Firefox.

If there are 2,000 files, we currently hit a stack depth of around 4,000 with the pass() rules, so it seems like we should be 10x short of exploding.

Anyway, this keeps us from increasing stack depth for menus that aren't currently open and stops Firebug from crashing.

Test Plan: Clicked 2000-diff revision in Firefox.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D2870
Allow specifying custom syntax highlighter

Summary: Related to D2873.

Test Plan: Specified it and verified that highlighting still works.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2874
Remove the actor itself from reviewer list in commandeering

Summary: When the commandeerer was a reviewer, after the commandeering, he stayed as a reviewer. He can no longer amend the diff. He has to go 'Edit Revision' to remove himself/herself. The fix is to remove it automatically.

Test Plan:
comamndeereded a revision and the behavior is correct now:
- I was removed from the revision list
- the comment transaction shows one more entry that I removed myself as a reviewer

Reviewers: epriestley, vrana

Reviewed By: vrana

CC: nh, vrana, aran, Korvin

Maniphest Tasks: T1225

Differential Revision: https://secure.phabricator.com/D2872
Simplify DifferentialHunk::getAddedLines()

Summary: I will also need `getRemovedLines()` so refactor this first.

Test Plan:
New test case.
Viewed uncached diff.
Verified that the only callsite of `getAddedLines()` trims lines.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2875
Implement a MySQL-backed global lock

Summary: Implementation is a little crazy but this seems to work as advertised.

Test Plan: Acquired locks with "lock.php". Verified they held as long as the process reamined open and released properly on kill -9, ^C, etc.

Reviewers: nh, jungejason, vrana, btrahan, Girish, edward

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1400

Differential Revision: https://secure.phabricator.com/D2864
Fix line count in diffs with more hunks per changeset

Summary: This error usually doesn't occur because we have only one hunk per changeset most of the time.

Test Plan:
  $hunk = new ArcanistDiffHunk();
  $hunk->setAddLines(1);
  $hunk->setDelLines(1);

  $change = new ArcanistDiffChange();
  $change->addHunk($hunk);
  $change->addHunk($hunk);

  $diff = DifferentialDiff::newFromRawChanges(array($change));
  var_dump($diff->getLineCount());

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2878
Allow 'repository.create' to set description and autoclose

Summary:
These are currently not available via Conduit.

Also fix a bug where bad JSON input triggers an error about undefined `$metadata`.

Test Plan: Ran 'repository.create' with and without a description and with and without autoclose. Verified the created repositories had the requested attributes.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D2881
Add a global lock for the RepositoryPullDaemon

Summary: Allow multiple daemons to run without contention.

Test Plan: Ran multiple daemons simultaneously in "debug" mode, observed them acquiring (and sometimes failing to acquire) locks.

Reviewers: btrahan, jungejason, nh

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1400

Differential Revision: https://secure.phabricator.com/D2877
Add a "Download Raw Diff" action to Differential

Summary: this lets people download diffs easily in case arc export, arc patch, etc isn't to their liking or whatever.

Test Plan: "Download Raw Diff" a few times with various things toggled in the "Revision Update History" widget

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1294

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