1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-22 10:18:48 +02:00
Commit graph

917 commits

Author SHA1 Message Date
vrana
2f508bf0dc Delete some phutil_safe_html()
Test Plan: Displayed revision.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4829
2013-02-05 15:52:48 -08:00
vrana
6bb7a282b1 Convert AphrontFormControl to safe HTML
Summary: Everything here now should properly handle plain strings and safe HTML.

Test Plan: /settings/panel/display/

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4826
2013-02-05 15:52:46 -08:00
Bob Trahan
1d0058abcf Update PeopleMenu to only show integration with applications if they are installed
Summary: do so via event engine. note different order now...

Test Plan: toggled "show beta applications" to off and noted that Conpherence disappeared. Otherwise noted that links showed.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2424

Differential Revision: https://secure.phabricator.com/D4708
2013-02-05 13:46:02 -08:00
epriestley
8f1311bbc1 Merge branch 'master' into phutil_tag
(Final sync.)
2013-02-05 10:23:16 -08:00
epriestley
94f6b6ca4e Fix every HTML issue I could find
Summary:
I attempted to test every interface. I probably missed some stuff, but I at least have some level of confidence that the `phutil_tag` branch is fairly stable.

Fixed these issues:

[1] Fixed a Herald issue with object links in transcripts. Some actions return
links; this was previously hard-coded.
[2] DarkConsole refactoring created an issue where the "`" event handler registered too many times.
[3] Fixed a bug where `strlen($value)` was being checked, but fields may now return array(). Possibly we should implement phutil_is_empty_html() or similar.
[4] Fixed a undefined variable issue for image edit transactions.
[5] Fixed an issue with rendering participant transactions. This required phutil_safe_html() because `pht()` can't handle `array()` for `%s`.
[6] Fixed an issue where feed was entirely overescaped by reverting an overly ambitious render_tag -> tag.
[7] Fixed an issue with strict tables and inserting `''` instead of `0` into an integer column.
[8] Fixed an issue where • was shown escaped.
[9] Fixed an issue where "no data" was overescaped.
[10] Fixed an issue with strict tables and inserting `''` instead of `0` into an integer column.
[11] Fixed an issue with strict tables and inserting `''`.
[12] Fixed an issue with missing space after ":" for mini panels.

Encountered (but did not fix) these issues:

[X1] "e" works incorrectly on comments you are not allowed to edit. Did not fix.
[X2] Coverage currently interacts incorrectly with "--everything" for Phutil tests.

Test Plan:
  - Viewed Differential.
  - Created a diff via copy/paste.
  - Viewed standalone diff.
  - Jumped to diff via changeset table.
  - Created a revision.
  - Updated revision.
  - Added a comment.
  - Edited revision dependencies.
  - Edited revision tasks.
  - Viewed MetaMTA transcripts.
  - Viewed Herald transcripts [1].
  - Downloaded raw diff.
  - Flagged / unflagged revision.
  - Added/edited/deleted inline comment.
  - Collapsed/expanded file.
  - Did show raw left.
  - Did show raw right.
  - Checked previews for available actions.
  - Clicked remarkup buttons
  - Used filetree view.
  - Used keyboard: F, j, k, J, K, n, p, t, h, "?" [2] [X1].
  - Created a meme.
  - Uploaded a file via drag and drop.
  - Viewed a revision with no reviewers.
  - Viewed a revision with >100 files.
  - Viewed various other revisions [3].
  - Viewed an image diff.
  - Added image diff inline comments.
  - Viewed Maniphest.
  - Ran various queries.
  - Created task.
  - Created similar task.
  - Added comments to tasks.
  - Ran custom query.
  - Saved custom query.
  - Edited custom queries.
  - Drag-reordered tasks.
  - Batch edited tasks.
  - Exported tasks to excel.
  - Looked at reports (issue in T2311 notwithstanding).
  - Viewed Diffusion.
  - Browsed Git, SVN, HG repositories.
  - Looked at history, browse, change, commit views.
  - Viewed audit.
  - Performed various audit searches.
  - Viewed Paste.
  - Performed paste searches.
  - Created, edited, forked paste.
  - Viewed Phriction.
  - Edited a page.
  - Viewed edit history.
  - Used search typeahead to search for user / application.
  - Used search to search for text.
  - Viewed Phame.
  - Viewed Blog, Post.
  - Viewed live post.
  - Published/unpublished post.
  - Previewed post.
  - Viewed Pholio.
  - Edited/commented mock.
  - Viewed ponder.
  - Viewed question.
  - Added answer/comment.
  - Viewed Diviner.
  - Viewed Conpherence [4] [5].
  - Made Conpherence updates.
  - Viewed calendar.
  - Created status.
  - Viewed status.
  - Viewed Feed [6].
  - Viewed Projects.
  - Viewed project detail.
  - Edited project.
  - Viewed Owners.
  - Viewed package detail.
  - Edited package [7].
  - Viewed flags.
  - Edited flag.
  - Deleted flag.
  - Viewed Herald.
  - Viewed rules.
  - Created rule.
  - Edited rule.
  - Viewed edit log.
  - Viewed transcripts.
  - Inspected a transcript.
  - Viewed People.
  - Viewed list.
  - Administrated user.
  - Checked username/delete stuff.
  - Looked at create/import LDAP/activity logs.
  - Looked at a user profile.
  - Looked at user about page.
  - Looked at Repositories.
  - Edited repository.
  - Edited arcanist project.
  - Looked at daemons.
  - Looked at all daemons [8].
  - Viewed combined log.
  - Looked at configuration.
  - Edited configuration.
  - Looked at setup issues [9].
  - Looked at current settings.
  - Looked at application list.
  - Installed / uninstalled applications [10].
  - Looked at mailing lists.
  - Created a mailing list.
  - Edited a mailing list.
  - Looked at sent mail.
  - Looked at received mail.
  - Looked at send/receive tests.
  - Looked at settings.
  - Clicked through all the panels.
  - Looked at slowvote.
  - Created a slowvote [11].
  - Voted in a slowvote.
  - Looked at Macro.
  - Created a macro.
  - Edited a macro.
  - Commented on a macro.
  - Looked at Countdown.
  - Created a Countdown.
  - Looked at it.
  - Looked at Drydock.
  - Poked around a bit.
  - Looked at Fact.
  - Poked around a bit.
  - Looked at files.
  - Looked at a file.
  - Uploaded a file.
  - Looked at Conduit.
  - Made a Conduit call.
  - Looked at UIExamples.
  - Looked at PHPAST.
  - Looked at PHIDs.
  - Looked at notification menu.
  - Looked at notification detail.
  - Logged out.
  - Logged in.
  - Looked at homepage [12].
  - Ran `arc unit --everything --no-coverage` [X2].

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4807
2013-02-04 17:06:34 -08:00
epriestley
af1f57b37a Add a preference to completely disable the file tree
Summary:
See D4812.

  - This preference disables the file tree completely.
  - It defaults off, so users who want it will have to go turn it on.
  - Maybe slightly cleaner would be doing this if the tree was hidden and then ajaxing it in if you press "F", but that's complicated and I don't want to bother.
  - Generally, I think this element is useful to something like 5% of users and not useful to 95%.

Test Plan: Enabled and disabled file tree. Looked at commits and revisions; verified they reflected the setting correctly.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D4813
2013-02-04 17:00:27 -08:00
vrana
0bb62d0c31 Make collapsed navigation sticky
Summary: This is the most requested feature in FB by far.

Test Plan:
Toggled, verified that data are saved.
Reloaded, toggled, toggled, toggled, verified that data are saved.
Reloaded.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4812
2013-02-04 16:35:46 -08:00
vrana
34c51a61b5 Delete preference for Diffusion symbols
Summary:
We are doing a better job in 1) of D3069#3 and 2) is just dumb.
Let's see if someone notices this change.

Test Plan: /settings/panel/display/

Reviewers: nh, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4789
2013-02-04 11:38:22 -08:00
vrana
8c99938aad Convert revision unsubscribers to edges
Test Plan: Ran the migration on a single revision, verified DB, called `loadUnsubscribedPHIDs()`.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4786
2013-02-04 11:36:55 -08:00
epriestley
0f1bdbe147 Merge branch 'master' into phutil_tag
(Sync.)
2013-02-04 06:19:52 -08:00
vrana
8e7af64dd6 Fix dynamic string usage as safe input in phutil_tag
Test Plan:
  $ arc lint

Reviewers: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4797
2013-02-02 16:10:09 -08:00
vrana
6e95901161 Convert phutil_render_tag() to phutil_tag() for inline comments
Test Plan:
Looked at file with lint errors in Diffusion.

I've also tried inline comments in Differential but it failed.
I'll try it again after you land all your diffs.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4755
2013-02-02 05:15:30 -08:00
vrana
a808133bc8 Not require confirmation for revision subscribe and unsubscribe
Summary: Regression to original behavior.

Test Plan: Clicked on it twice, didn't see confirmation dialog.

Reviewers: epriestley, codeblock

Reviewed By: codeblock

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4788
2013-02-02 03:52:24 -08:00
vrana
b7e10831a6 Use PhutilNumber instead of number_format()
Summary: Also convert to `phutil_tag()`.

Test Plan: Displayed revision with hidden comments.

Reviewers: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4772
2013-01-31 17:12:12 -08:00
vrana
01236dcaf0 Use PhutilNumber in translations
Summary: It's a little bit confusing that you couldn't use %d but kind of expected taken that the number will be formatted so it's not a number anymore.

Test Plan: /paste/

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4764
2013-01-31 09:11:01 -08:00
epriestley
7f43826854 render_tag -> tag: fix more callsites (more view, misc)
Summary: Fixes even more callsites.

Test Plan: See inlines.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4749
2013-01-31 09:08:02 -08:00
Kwadwo Nyarko
c1e9b20d78 differential now displays date created and date modified info
Summary: Added date created and date modified to diff

Test Plan: Creat a new diff. Check to see that dateCreated and dateModified appear

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4756
2013-01-30 20:25:12 -08:00
epriestley
f705c978b5 render_tag -> tag: phabricator_render_form -> phabricator_form
Summary: Convert most phabricator_render_form callsites. In the case of the "headsup view", it converts it by deleting the element entirely (this is the very old Maniphest/Differential header which we no longer use).

Test Plan: Poked around a bit.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4726
2013-01-30 11:30:38 -08:00
epriestley
74a90999d8 render_tag -> tag: phabricator_form, differential inline comment
Summary: Pretty straightforward.

Test Plan: Viewed inline edit on left / right and new /edit.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4724
2013-01-30 11:24:30 -08:00
epriestley
0a9f378594 render_tag -> tag: Differential Changeset stuff
Summary: I cheated in a couple of places here, but this is in the process of getting refactored anyway, and there's a pretty clear boundary.

Test Plan: Viewed changesets in Differential, viewed standalone. Viewed context elements.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4723
2013-01-30 10:58:21 -08:00
Bob Trahan
9e7ac9a47e fix differential style break if you cancel inline comment before posting
Summary: see title. Thanks for the report @poop

Test Plan: loaded up FF, left a comment but did not submit and instead cancelled - observed sane UI

Reviewers: epriestley, vrana, poop

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2460

Differential Revision: https://secure.phabricator.com/D4728
2013-01-29 15:43:38 -08:00
vrana
1ebd51aad2 Not include mailing lists in revisions search
Summary: Neither author nor reviewer can be a mailing list.

Test Plan: /differential/filter/revisions/, saw "Type a user name".

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4722
2013-01-29 12:12:05 -08:00
epriestley
39221b1d3f Merge branch 'master' into phutil_tag
(Synchronizing.)
2013-01-29 11:05:02 -08:00
epriestley
40547030a5 render_tag -> tag: PropertyListView
Summary: Converts callsites in PropertyListView (addDetail() and setTextContent()).

Test Plan: Grepped for PhabricatorPropertyListView, addDetail() and setTextContent().

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4695
2013-01-29 11:01:47 -08:00
epriestley
da27b448fa render_tag -> tag: DifferentialResultsTableView
Summary: Fix lint and unit results escaping.

Test Plan:
Looked at lint/unit results. Clicked show/hide:

{F30680}

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4693
2013-01-28 18:46:04 -08:00
epriestley
edfcd7bd2d render_tag -> tag: phame, remarkup
Summary: Converts various callsites from render_tag variants to tag variants.

Test Plan: See inlines.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4689
2013-01-28 18:44:15 -08:00
vrana
a9fb828635 Display proper number in too large diff
Summary: Also avoid trailing space in translation.

Test Plan: Displayed diff with 7000 files.

Reviewers: chad, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4705
2013-01-28 13:33:37 -08:00
Chad Little
5dc48c2b4a pht, panels and mobile for metamta
Summary: Added phts, tested forms on mobile.

Test Plan: Review each page in Chrome and iOS.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4702
2013-01-28 10:48:01 -08:00
epriestley
f9030885c4 Merge branch 'master' into phutil_tag
(Just synchronizing master into the tag branch.)
2013-01-27 06:02:06 -08:00
epriestley
f6622f43e6 Replace all array_combine(x, x) with array_fuse(x) in Phabricator
Summary: Fixes various array_combine() warnings for PHP < 5.4

Test Plan: lint/unit/grep

Reviewers: btrahan, vrana, chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D4660
2013-01-25 17:06:55 -08:00
epriestley
3093d1663d Add javelin_tag(), convert easy callsites
Summary:
  - Implements `javelin_tag()`, which is `javelin_render_tag()` on top of `phutil_tag()` instead of `phutil_render_tag()`.
  - Manually converts all or almost all of the trivial callsites.

Test Plan:
  - Site does not seem any more broken than before.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D4639
2013-01-25 12:57:17 -08:00
vrana
9670f0c636 Convert phutil_render_tag(X, Y, phutil_render_tag(...)) to phutil_render_html
Summary:
Created with spatch:

  lang=diff
  - phutil_render_tag
  + phutil_render_html
    (X, Y, phutil_render_tag(...))

  - phutil_render_tag
  + phutil_render_html
    (X, Y, phutil_render_html(...))

Test Plan: Loaded homepage

Reviewers: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4502
2013-01-24 19:35:51 -08:00
vrana
3c1b8df8ae Convert simple phutil_render_tag() to phutil_tag()
Summary: Done manually.

Test Plan: Loaded homepage.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4509
2013-01-24 19:30:50 -08:00
vrana
21a5956a35 Convert phutil_render_tag(X, Y, pht('...')) to phutil_tag
Summary:
Created with spatch:

  lang=diff
  - phutil_render_tag
  + phutil_tag
    (X, Y, pht('...'))

The searched for `<` and `&` by sgrep.

Test Plan: Loaded homepage.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4504
2013-01-24 19:20:30 -08:00
vrana
20768d65d5 Convert phutil_render_tag(X, Y, '...') to phutil_tag
Summary:
Created with spatch:

  lang=diff
  - phutil_render_tag
  + phutil_tag
    (X, Y, '...')

Then searched for `&` and `<` in the output and replaced them.

Test Plan: Loaded homepage.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4503
2013-01-24 19:20:27 -08:00
vrana
48561a8b1f Convert phutil_render_tag(X, Y, phutil_escape_html(Z)) to phutil_tag
Summary:
Created with spatch:

  lang=diff
  - phutil_render_tag
  + phutil_tag
    (X, Y,
  - phutil_escape_html(
    Z
  - )
    )

Test Plan: Loaded homepage

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4501
2013-01-24 19:08:55 -08:00
vrana
f8dbfdd59d Convert phutil_render_tag(X, Y) to phutil_tag
Summary:
Created with spatch:

  lang=diff
  - phutil_render_tag
  + phutil_tag
    (X, Y)

(and null manually)

Test Plan: Loaded homepage

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4500
2013-01-24 19:08:54 -08:00
vrana
576dcc65b3 Sort Blocking Others revisions from the oldest
Test Plan: Looked at homepage and Differential homepage.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4629
2013-01-24 16:24:22 -08:00
vrana
3a3ab08aba Split Revisions Waiting On You
Summary: Revisions you should review usually require faster response than revisions you should update or commit.

Test Plan:
/
/differential/

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4606
2013-01-24 13:51:55 -08:00
Chad Little
52104a4b54 More Differential PHT
Summary: I think I've gotten like 95% of Differential now. Some outliers that need rethinking.

Test Plan: Bring up a new diff, edit a diff, search and sort diffs.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4623
2013-01-24 13:18:44 -08:00
Ricky Elrod
e990488889 Set some defaults back to correctness.
Summary:
There were a few defaults that got changed when porting to PHP. Most of them
seem to be accidental, so this diff sets them back to correctness.

Test Plan:
  php> require '../libphutil/src/__phutil_library_init__.php';
  php> require 'src/__phutil_library_init__.php'
  php> $a = PhabricatorApplicationConfigOptions::loadAllOptions()
  php> $b = require 'conf/default.conf.php';
  php> $x = array();
  php> foreach($a as $key => $obj) { $x[$key] = $obj->getDefault(); }
  php> foreach($x as $key => $default) { if ($b[$key] != $default) { echo "$key has different default.\n"; } }

  log.access.format has different default.
  (seems to be intentional)

  PHP Notice:  Undefined index: phabricator.env in /usr/lib/python2.7/site-packages/phpsh/phpsh.php(577) : eval()'d code on line 1
  (no longer in config file)

  PHP Notice:  Undefined index: test.value in /usr/lib/python2.7/site-packages/phpsh/phpsh.php(577) : eval()'d code on line 1
  (not in config file)

  metamta.default-address has different default.
  (intentional)

  metamta.domain has different default.
  (intentional)

  PHP Notice:  Undefined index: phid.external-loaders in /usr/lib/python2.7/site-packages/phpsh/phpsh.php(577) : eval()'d code on line 1
  (no longer in config file)

  phame.skins has different default.
  (fixed in D4618)

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4621
2013-01-24 12:10:41 -08:00
Chad Little
68affb72ec PHT's for Differential.
Summary:
Went through this last night, I had to remove some static vars, but didn't see that as a huge perf issue.

Lint

Test Plan: Tested numerous differential pages, creating a diff, commenting, editing.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4617
2013-01-24 10:46:47 -08:00
epriestley
c95dcab439 Set hard-coded defaults for list<string> values to array()
Summary: These should default to array() so they're safe to `foreach` over.

Test Plan: Grepped for 'list<string>'.

Reviewers: codeblock, btrahan, starruler, vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D4600
2013-01-23 13:12:23 -08:00
Ricky Elrod
dce6d2e9d5 Make the 'Subscribe' button pop a modal instead.
Summary:
See title.

Also some minor styling/consistency fixes.

Test Plan:
- Clicked subscribe
- Canceled to make sure it went away
- Clicked it again
- Clicked subscribe
- Saw my name in the cc field.

Reviewers: epriestley, chad, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4571
2013-01-21 18:41:54 -08:00
Nick Pellegrino
3e6fa43658 getConfigEnv fails fast when key is not found and no default value is given.
Summary:
T2345
getConfig throws an Exception when the key does not exist.
Also removes dead code that throws an Exception.

Test Plan:
Reloaded the Phabricator home page.  In the process, found
2 Exceptions thrown due to nonexistent keys.  After addressing these problems,
the home page loads without Exceptions.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4541
2013-01-19 12:11:28 -08:00
Debarghya Das
06bca93b47 Expanded Regexp for matching tasks to include more tenses
Summary: Fixed T2354

Test Plan: Testing in progress until this task is resolved.

Reviewers: epriestley

CC: aran, Korvin

Maniphest Tasks: T2354

Differential Revision: https://secure.phabricator.com/D4542
2013-01-19 11:34:34 -08:00
Nick Pellegrino
3802007082 A closed commit can be reopened, if allowed by the config file.
Summary: Fixes T2316

Test Plan:
When the config file allows reopening,
navigate to a closed revision and reopen it in the user interface,
and verify that the revision now "needs review."
Also checks that the reopen option is unavailable when disallowed
by the config file.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2316

Differential Revision: https://secure.phabricator.com/D4526
2013-01-19 09:10:18 -08:00
vrana
6c44e704b5 Delete differential.updatetaskrevisionassoc
Summary: Used only by Facebook.

Test Plan: Moved to Facebook repo and verified it still works.

Reviewers: nh, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4515
2013-01-18 18:20:53 -08:00
epriestley
141d479104 Restore some title glyphs to new-style applications
Summary: Not all applications' glyphs survived the migration. Restore them.

Test Plan: Looked at Differential, Phriction, Ponder. Saw title glyphs in page titles.

Reviewers: lesha, btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4489
2013-01-17 15:04:57 -08:00
vrana
df8d0a578b Correctly handle unset generated paths 2013-01-16 16:57:09 -08:00
epriestley
a9ff58ff27 Add even more Differential options
Summary:
These are technically in MetaMTA right now, but I put them in Differential since I think it's probably a better primary category fit and having 120 options in MetaMTA won't do anyone any favors. (We can do some kind of cross-categorization or "related options" later if we get feedback that people are having trouble finding options like these which have multiple reasonable categories.)

Also improve the readability of displayed JSON literals with forward slashes.

Test Plan: Looked at options, edited a couple of them. Looked at JSON literal values, saw them rendered more readably.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4464
2013-01-16 09:01:16 -08:00
epriestley
0b7f760a41 Base class of differential.field-selector should be DifferentialFieldSelector, not DifferentialDefaultFieldSelector
Summary: Missed this -- the "Default" flavor extends from the actual abstract base.

Test Plan: Loaded setup issues, no longer saw an issue raised for my local extension class.

Reviewers: codeblock

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4463
2013-01-16 09:00:20 -08:00
Ricky Elrod
e974ffea7f Remove curly braces around line count.
Summary:
I'm assuming they aren't meant to be there.

Old:
This file has a very large number of changes ({4,032} lines). Show File Contents

New:
This file has a very large number of changes (4,032 lines). Show File Contents

Test Plan:
Saved a 5000-line test file, diffed from /dev/null, uploaded diff to local
instance, viewed.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4462
2013-01-16 07:26:40 -08:00
Ricky Elrod
7857508185 Finish Differential options.
Test Plan: Saw the new options show up, saved some of them.

Reviewers: epriestley, chad, btrahan

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4443
2013-01-15 13:17:23 -08:00
epriestley
4566b86376 Fix two diff rendering bugs
Summary:
  - The order of operations for file changes is wrong. We need to wrap them in a table, then render the changeset talbe around that table.
  - Line data was being set to late, so renderShield() got the wrong line count and rendered empty diffs behind, e.g., generated changes.

Test Plan: Looked at an image change with property changes. Clicked "show file contents" on a generated file.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4432
2013-01-15 08:07:40 -08:00
Chad Little
e2e890672a Adds a new 'setnobackground' panel class, implements in Differential / Diffusion.
Summary: Still working through basic re-design. Adds the ability to re-use panel view without the background.

Test Plan: Viewed Diffusion and Differential in Chrome, FF, Safari.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4430
2013-01-14 16:40:04 -08:00
epriestley
901328088d Render inline comments somewhat-correctly on 1-up diffs
Summary: You can't interact with them yey, but do a less awful job of rendering them.

Test Plan: {F29204}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4426
2013-01-14 14:20:54 -08:00
epriestley
ea8faedf0b Add very basic 1-up HTML renderer support
Summary:
  - Add a query parameter to select the diff renderer.
  - When we populate diffs, use the 1-up renderer if the device isn't a desktop. Don't switch renderers once the page has loaded since it will be a tremendous mess. We can add an "always use 1-up" preference later.
  - Tweak JX.Device so we avoid a race condition, where `JX.Device.getDevice()` may not be valid when other behaviors run.
  - Implement enough of the 1-up HTML renderer to provide a vague hint that it actually works.
  - Fix a couple of bugs with primitive construction.

Test Plan:
{F29168}
{F29169}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4423
2013-01-14 14:20:35 -08:00
epriestley
2de107f21b Remove DifferentialChangesetRenderer->(g|s)etLineCount()
Summary: The "line count" is always the same as count($this->getOldLines()), and somewhat misleading since it's really "number of rows in the two-up view". D4421 removed the only (or only remaining?) call.

Test Plan: looked at some diffs

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4422
2013-01-14 14:20:26 -08:00
epriestley
612b29fff4 Implement basic one-up and test renderers
Summary:
This is a half-step toward one-up and test renderers. This is mostly a structural change, and has no user-facing impact. It splits the rendering hierarchy like this:

  - Renderer (more methods are abstract than before)
    - HTML Renderer (most HTML stuff has moved down from the base to here)
      - HTML 1-up (placeholder only -- not yet a functional implementation)
      - HTML 2-up (minimal changes, uses mostly old code)
    - Test Renderer (unit-testable renderer base, implements text versions of the HTML stuff)
      - Test 1-up (selects 1-up mode for test rendering)
      - Test 2-up (selects 2-up mode for test rendering)

Broadly, I'm trying to share as much code as possible by splitting rendering into more, smaller stages. Specifically, we do this:

  - Combine the various sorts of inputs (changes, context, inlines, etc.) into a single, relatively homogenous list of "primitives". This happens in the base class.
    - The primitive types are: old (diff left side), new (diff right side), context ("show more context"), no-context ("context not available") and inline (inline comment).
  - Possibly, apply a filtering/reordering step to the primitives to get them ready for 1-up rendering. This mostly removes information, and does a small amount of reordering. This also happens in the base class.
  - Pass the primitives to the actual renderer, to convert them into HTML, text, or whatever else. This happens in the leaf class.

The primitive implementation is not yet complete (it doesn't attach as much information to the primitives as it should -- stuff like coverage and copies), but covers the basics.

The existing HTMLTwoUp renderer does not use the primitive path; instead, it still goes down the old path.

Test Plan: Ran unit tests, looked at a bunch of diffs.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4421
2013-01-14 14:20:06 -08:00
Chad Little
ff91884f7d Dark sidebar everywhere
Summary:
First pass at testing out a dark sidebar everywhere. Wanting feedback with real test time before implementing before commiting.

Thoughts
- Aligns with Mobile, Tablet UI experience.
- Creates 'application' feel on Desktop.
- Begins to make Phabricator feel like a branded UI.

Cons
- Probably contensious visually.

TODO:
- Update diff view sidebar.
- Make breadcrumbs appear above content area, not above nav.
- Change background texture on crumbs to match table headers.

Test Plan: Testing Nav with fellow co-workers.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4427
2013-01-14 13:40:51 -08:00
Ricky Elrod
ab9556345f Left-align dates on /differential.
Test Plan: Went to /differential.

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4415
2013-01-11 16:56:20 -08:00
vrana
b0edca7294 Display #1 instead of #comment-1 in comment anchors
Summary: I changed this a long time ago probably without knowing that this format is usable in Remarkup.

Test Plan: Viewed revision and task.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4413
2013-01-11 15:51:21 -08:00
epriestley
dbdb01f858 Fix whitespace and unchanged file shields
Summary:
Fixes T181. I actually have no idea what the original issue in T181 was, but this fixes several problems:

  - The code for figuring out whitespace-only changes was extremely confusing and probably buggy (the code for figuring out unchanged files was equally confusing but probably less buggy).
  - When rendering a whitespace shield, we did not offer a "Show Changes" link. Instead, show the "Show Changes" link: we can always render the content beneath this link.
  - When clicking "Show Changes", we used the current whitespace mode, which might result in a diff with no changes. Instead, force "show all" whitespace mode.
  - We never offered a "show changes" link for unchanged files. Instead, offer this link if we can service it.
  - When clicking "Show Changes", we pierced the shield but didn't force file content, which would fold the entire file even if it was available. Instead, force the file content.

Test Plan: Generated whitespace-only and no-change diffs. Clicked shield links, or verified no shield link available in no-change-with-no-content. Generated an "@generated" change, verified shield worked correctly.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T181, T2009

Differential Revision: https://secure.phabricator.com/D4407
2013-01-11 15:27:42 -08:00
epriestley
039a5a6d86 Simplify hunk parsing
Summary:
Simplify whitespace-ignoring diffing:

  - Currently, we generate two diffs (one ignoring whitespace, one normal) and then copy the //text content// from the normal one to the whitespace-ignoring one.
  - Instead, copy the //change types// from the ignoring one to the normal one.
    - This is cheaper and much simpler.
    - It means that we have the right change types in reparseHunksForSpecialAttributes(), and can simplify some other things.

Simplify whitespace changes, unchanged files, and deleted file detections:

  - Currently, we do this inline with a bunch of other stuff, in the reparse step.
  - Instead, do it separately. This is simpler.

Simplify intraline whitespace handling:

  - Currently, this is a complicated mess that makes roughly zero sense.
  - Instead, do it in reparse in a straightforward way.

Partially fix handling of files changed only by changing whitespace.
Partially fix handling of unchanged files.

Test Plan:
  - Ran unit tests.
  - Created context-less diffs, verified they rendered reasonably.
  - Generated a diff with prefix whitespace, suffix whitespace, intraline whitespace, and non-whitespace changes. Verified changes rendered correctly in "ignore most" and "show all" modes.
  - Verified unchanged files and files with only whitspace changes render with the correct masks.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4398
2013-01-11 15:25:15 -08:00
vrana
dbeb60adbe Display other locations of lint errors
Summary:
Depends on D4392.

I don't plan on adding these to changesets.

Test Plan: Added `$message['locations'] = array(array('line' => 10));` in the code and displayed a revision with lint problems.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4394
2013-01-11 14:04:29 -08:00
vrana
d04bc0747c Allow filtering Differential overviews by other participants
Summary:
This is useful for writing feedback - what did I work on with someone?
This creates `AND IN (...)` and not `AND AND AND` if more participants are specified.
User may not expect it but whatever, it works the same for the most common case of 1 extra participant.
It would be nice to have this also for other filters but it would by way harder.

Test Plan: Displayed my revisions with some specific reviewer and some elses revisions with me as reviewer.

Reviewers: epriestley

Reviewed By: epriestley

CC: wez, aran, Korvin

Differential Revision: https://secure.phabricator.com/D4408
2013-01-11 13:45:25 -08:00
vrana
c59aeb22fe Allow displaying more users at once in Differential overview
Summary:
I want to check the work of several people (bootcampers) at once.
This implements the OR filter required for that.
In the next diff, I plan to implement also the AND filter which can be useful too.

Test Plan:
Searched for several people, clicked all filters.
Searched for one person, verified that pretty URL is still created.

Reviewers: epriestley

Reviewed By: epriestley

CC: wez, aran, Korvin

Differential Revision: https://secure.phabricator.com/D4404
2013-01-11 12:32:33 -08:00
epriestley
6a69108358 Simplify context parsing and add test coverage
Summary:
  - Remove 'missingNew', etc. It's impossible for a diff to popluate these, as far as I can tell (I can't generate such a diff, or find any which generate it).
  - Add unit tests.

Test Plan: Unit tests, viewed a diff with some missing context.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4393
2013-01-10 16:06:39 -08:00
epriestley
9aeebbbf58 Fix "context not available" in contextless diffs
Summary: D4351 swapped this from a map to a list, and then stopped it from getting to the ChangesetParser so it didn't make it to the Renderer.

Test Plan: Ran "arc diff", copy/pasted it into the web UI. Saw a diff with "context not available" blocks in between missing contexts.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4384
2013-01-10 09:51:52 -08:00
Bob Trahan
f1d7c8fbf8 fix whitespace mode for differentialHunkParser
Summary: I forgot to "set it" from the changeset parser.

Test Plan: made a diff with silly whitespace changes. toggled the various whitespace modes and got appropriate results

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4378
2013-01-09 13:28:27 -08:00
Bob Trahan
84c27ae255 re-factor DifferentialChangesetParser pass 3 / N
Summary: introducing a new friend called DifferentialHunkParser. Sort of like the DifferentialChangesetParser but works with hunks only. tried to grab hunk parsing type things from across the code base and move them into this new class.

Test Plan: unit tests and played around in Differential a bit.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4351
2013-01-09 13:11:17 -08:00
Ricky Elrod
abee691bc1 Fix more boolean reversals.
Summary: Missed these in D4357.

Test Plan: Meh.

Reviewers: epriestley, chad

Reviewed By: chad

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4371
2013-01-09 08:33:56 -08:00
Ricky Elrod
71b5d8f584 Default to "True" and "False" for bool options.
Summary:
Rather than throwing if we don't `setOptions()`, let's just default to `true`
and `false`.

Test Plan:
Removed a `setOptions()` call temporarily and saw options default to
`true` / `false`.

Reviewers: epriestley, btrahan, chad

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4368
2013-01-09 08:14:29 -08:00
epriestley
f12dbe36d6 Raise a better error when a file upload fails in Differential
Summary:
Ref T2296. If a file upload fails (e.g., too large), we read the textarea from the "Create New Diff" interface. This means we show the user an error like "empty diff" when we should show them an error like "file upload failed, patch is too large". This is part of the issue in T2296, which features a 2.5MB diff.

Instead, check if a file was specified, so we'll raise a better error.

Test Plan: Tried to upload a large patch, got a "file is too large" error instead of an empty-diff-related error.

Reviewers: btrahan, vrana, codeblock

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2296

Differential Revision: https://secure.phabricator.com/D4369
2013-01-09 08:14:17 -08:00
epriestley
b852f213c3 Begin moving Phabricator configuration into PHP
Summary: Ref T2255. Ref T2221. Lay the groundwork to move configuration into PHP, so we can show descriptions in the web UI, do typechecking, disable application options when an application is uninstalled, etc.

Test Plan:
{F28421}
{F28420}
{F28422}

Reviewers: codeblock, btrahan, vrana

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2221, T2255

Differential Revision: https://secure.phabricator.com/D4306
2012-12-30 15:36:06 -08:00
epriestley
cb228ed4e3 Fix write to undefined property $_hunks
Summary: Some time long in the past, this was renamed to unsavedHunks. Fixes T2249.

Test Plan: Ran `destroy_revision.php D20`, got a successful destruction.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2249

Differential Revision: https://secure.phabricator.com/D4304
2012-12-30 13:44:48 -08:00
epriestley
f6b1964740 Improve Search architecture
Summary:
The search indexing API has several problems right now:

  - Always runs in-process.
    - It would be nice to push this into the task queue for performance. However, the API currently passses an object all the way through (and some indexers depend on preloaded object attributes), so it can't be dumped into the task queue at any stage since we can't serialize it.
    - Being able to use the task queue will also make rebuilding indexes faster.
    - Instead, make the API phid-oriented.
  - No uniform indexing API.
    - Each "Editor" currently calls SomeCustomIndexer::indexThing(). This won't work with AbstractTransactions. The API is also just weird.
    - Instead, provide a uniform API.
  - No uniform CLI.
    - We have `scripts/search/reindex_everything.php`, but it doesn't actually index everything. Each new document type needs to be separately added to it, leading to stuff like D3839. Third-party applications can't provide indexers.
    - Instead, let indexers expose documents for indexing.
  - Not application-oriented.
    - All the indexers live in search/ right now, which isn't the right organization in an application-orietned view of the world.
    - Instead, move indexers to applications and load them with SymbolLoader.

Test Plan:
  - `bin/search index`
    - Indexed one revision, one task.
    - Indexed `--type TASK`, `--type DREV`, etc., for all types.
    - Indexed `--all`.
  - Added the word "saboteur" to a revision, task, wiki page, and question and then searched for it.
    - Creating users is a pain; searched for a user after indexing.
    - Creating commits is a pain; searched for a commit after indexing.
    - Mocks aren't currently loadable in the result view, so their indexing is moot.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: 20after4, aran

Maniphest Tasks: T1991, T2104

Differential Revision: https://secure.phabricator.com/D4261
2012-12-21 14:21:31 -08:00
epriestley
62bc3373e5 Fix error with inline comments on images
Summary: This data structure is a `dict<int, list<Comment>>` now, where the `int` is the line number.

Test Plan:
  - Created a diff changing an image.
  - Added inline comments on the left and right sides of the diff.
  - Saw some exceptions and general sadness.
  - Applied patch.
  - Reloaded page.
  - Everything worked great.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4264
2012-12-21 14:16:00 -08:00
vrana
2cc7f82ece Move Conduit methods inside applications
Test Plan:
/conduit/
/conduit/method/arcanist.projectinfo/
Call method

  $ echo '{}' | arc call-conduit user.whoami

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4268
2012-12-21 12:21:59 -08:00
vrana
9358b08b46 Use "Diff <id>" instead of "D<id>" in changeset view
Summary: We use "D<id>" for revisions.

Test Plan: Looked at revision.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4258
2012-12-20 18:28:34 -08:00
vrana
ef214e94ce Move setUser() to AphrontView
Summary: This is used in every other view.

Test Plan: Browsed around.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4248
2012-12-20 14:49:52 -08:00
Bob Trahan
fcc5366eff fix differential + diffusion for showing generated files
Summary: in the re-factor quest this got broken. Turns out NewLines (aka $this->new in the parser) gets updated right up until the very end for showing text changes so instead pass over the total line count to the renderer to get this codepath right.

Test Plan: showed content of some generated files in diffusion and all was well

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2204

Differential Revision: https://secure.phabricator.com/D4237
2012-12-19 10:56:00 -08:00
vrana
79b241b31d Render warning instead of error for postponed lint
Test Plan: {F27152, size=full}

Reviewers: epriestley

Reviewed By: epriestley

CC: ypisetsky, aran, Korvin

Differential Revision: https://secure.phabricator.com/D4195
2012-12-17 12:30:42 -08:00
Bob Trahan
5b15f725bd differntial and diffusion design tweaks
Summary: most awesome is that differential-primary-pane no longer has a place in diffusion. less awesome is fixing the zebra striping on differential "Local Commits" view and making the font size of one of the table headers match the others.

Test Plan: looks good!

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4177
2012-12-13 10:46:41 -08:00
epriestley
406833ba90 Minor, fix a variable name after recent refactoring.
Test plan: Observed no fatal when viewing a diff which removes an image.

Auditors: btrahan
2012-12-13 09:49:03 -08:00
Bob Trahan
29730ca142 derp on a derp 2012-12-12 21:24:17 -08:00
Bob Trahan
86a106d0b1 cowboy commit -- fixing fatal I introduced from D4174
Summary: we don't always have a diff so instead set an explicit title in the controller.

Test Plan: no more fatals. grepped carefully for every call site and tested them all
2012-12-12 21:21:56 -08:00
Bob Trahan
2f82210e46 differential - lazy man's attempt at updated design
Summary: basically made the header elements for the individual panes and cleaned up the panes to make it look okay. tried to copy colors from @chad 's mocks.

Test Plan: looks good to me

Reviewers: epriestley, chad

Reviewed By: chad

CC: aran, Korvin

Maniphest Tasks: T2004

Differential Revision: https://secure.phabricator.com/D4174
2012-12-12 21:00:35 -08:00
Nick Harper
e7bcdcdb94 Make differential revision ID parsing more robust
Summary:
If something that doesn't belong to any field appears in the commit message
below the differential revision field, it gets included as part of the
value for the field, which can mess up parsing.

Test Plan:
called differential.parsecommitmessage on a commit whose differential
revision field wasn't being parsed earlier (it had a line of dashes two
lines below the Differential Revision: line).

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4171
2012-12-12 20:01:42 -08:00
Bob Trahan
9e8387175e upgrade diffusion to use modern header UI and fix a few quirks
Summary:
upgrades are CrumbsView, HeaderView, PropertyListView, and ActionListView. I had to modify CrumbsView stuff a bit to handle the "advanced" diffusion crumbs.

Quirks fixed include making file tree view show up in diffusion, the page not have extra space when the file tree is hidden, links no longer breaking once you visit files (since without the change the files always got "/" appended and thus 404'd), and a differential quirk where it read "next step:" and that colon is a no no,

Test Plan: played around in diffusion and differential

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, chad

Maniphest Tasks: T2048, T2178

Differential Revision: https://secure.phabricator.com/D4169
2012-12-12 17:50:42 -08:00
Bob Trahan
c970f7e89c refactor pass 2 of N on DifferentialChangesetParser and bonus bug fix
Summary: pull out some more stuff from the TwoUp renderer that's generically useful. also clean up $xhp variable and add a get method for the $coverage. Finally, fix T2177 while I'm in here.

Test Plan: played around with Differential. Also opened things up in Firefox to verify T2177.

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2009, T2177

Differential Revision: https://secure.phabricator.com/D4161
2012-12-11 17:16:11 -08:00
vrana
40e3aadc76 Parse Conflicts field in commit message
Summary:
Git adds it automatically.

I don't like this solution much because there could be other unknown fields appended to the end of the commit message which will break parsing.

Test Plan:
Reparsed commit ending with:

> Differential Revision: ...
> Conflicts: ...

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4157
2012-12-11 16:52:14 -08:00
Bob Trahan
bfc5bb7c78 change DifferentialRevisionDetailView to use newer fangled UI abstractions
Summary: actions are still a bit messy - unsatisfactory icons (T2013 will help!)

Test Plan: viewed diffs - they look good

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: chad, aran, Korvin

Maniphest Tasks: T2007

Differential Revision: https://secure.phabricator.com/D3904
2012-12-11 14:59:27 -08:00
epriestley
6ed02e6ee8 Restore "Reply" action to Differential inline comments
Summary: Minor issue from D4117, user doesn't get passed down so inline comments are missing their "reply" link.

Test Plan: Looked at Differential, saw reply link.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4145
2012-12-10 15:12:32 -08:00
vrana
89ab9d4acb Support git svn dcommit in arc land
Test Plan: Displayed accepted Git SVN revision.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4124
2012-12-10 12:29:59 -08:00
hfcorriez
81d59a0b77 Fix call to undefined method for DifferentialChangesetParser::originalRight() 2012-12-10 17:47:58 +08:00
Bob Trahan
fb1a6575dc fix inline comment for new differential fluid view
Summary: we need to render left and right* classes as appropriate, plus colspan for the right

Test Plan: made inline comments and it was no longer borked

Reviewers: vrana, epriestley, chad

Reviewed By: chad

CC: aran, Korvin

Maniphest Tasks: T2005

Differential Revision: https://secure.phabricator.com/D4131
2012-12-08 16:50:44 -08:00
Bob Trahan
638449b483 removed some debugging code from D4117
Summary: whoops!

Test Plan: no more debugging code

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4121
2012-12-07 18:08:27 -08:00
Bob Trahan
75e8ff26f5 Refactor DifferentialChangesetParser -- pass 1 of N
Summary:
basically did my darnedest to pull out a TwoUp rendering view. Made a base class for the rendering views with "old" and "new" terminology rather than "left" and "right.

Future revisions will finish cleaning up the terminology within the DifferentialChangesetParser itself and more of the ideas within T2009.

Test Plan: been playing with differential all day

Reviewers: epriestley

Reviewed By: epriestley

CC: vrana, chad, aran, Korvin

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4117
2012-12-07 16:19:57 -08:00
Bob Trahan
08172cf361 fluid diff -- more table silliness
Summary: inline comments eat up all 3 tds and no code coverage should be shown.

Test Plan: verified in FIREFOX that inline comments looked good

Reviewers: vrana, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2005

Differential Revision: https://secure.phabricator.com/D4115
2012-12-07 15:53:24 -08:00
epriestley
cd2e39025e Add crumbs to Differential
Summary: Adds very basic crumbs to Differential, to prevent regression when we drop the application menu. I'll do a more proper pass at this but want to unblock landing the commit sequence for all this stuff.

Test Plan: Looked at detail view and list view, saw crumbs, clicked them.

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T1960

Differential Revision: https://secure.phabricator.com/D4111
2012-12-07 13:37:45 -08:00
epriestley
f306cab653 Use application icons for "Eye" menu and Crumbs
Summary:
Issues here:

  - Need an application-sized "eye", or a "home" icon for "Phabricator Home".
  - Some of the "apps_lb_2x" sliced images are the "_dark_" versions, not the light versions.
  - If you slice an application-sized "logout" (power off) icon and application-sized "help" (questionmark in circle) icon I can replace the current menu icons and nearly get rid of "autosprite".
  - To replace the icons on /applications/, the non-retina size is "4x", so we'd need "8x" for retina. Alternatively I can reduce the icon sizes by 50%.
  - The "Help", "Settings" and "Logout" items currently have a "glowing" hover state, which needs a variant (or we can drop it).
  - The /applications/ icons have a white hover state (or we can drop it).
  - The 1x application (14x14) icons aren't used anywhere right now, should they be? Maybe in the feed in the future, etc?
  - The "apps-2x" and "apps-large" sheets are the same image, but getting them to actually use the same file is a bit tricky, so I just left them separate for now.

Test Plan:
{F26698}
{F26699}

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T1960

Differential Revision: https://secure.phabricator.com/D4108
2012-12-07 13:37:28 -08:00
epriestley
dd94512837 Abstract and further merge filter menus
Summary:
  - Adds `PhabricatorMenuItemView` which is a non-hacky object representing a single menu item.
  - Adds `PhabricatorMenuView`, a collection of items.
  - Deletes some busted/old interfaces full of garbage nonsense.
  - Merges menu item styles from `aphront-side-nav-view-css` and `phabricator-nav-view-css`. These are old-style and new-style rules which got partially updated recently.
    - The new-style menus have a darker background (#ececec) than the old-style menus (#f7f7f7) so some of the highlight/hover colors weren't visible. I shuffled them around but something or other might need further adjustment.

Test Plan: looked at every menu I could

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T1960

Differential Revision: https://secure.phabricator.com/D4036
2012-12-07 13:32:14 -08:00
epriestley
20ee3003b5 Replace all instances of AphrontSideNavView with AphrontSideNavFilterView
Summary:
AphrontSideNavView is an old class which required you to do a lot of work; it was obsoleted by AphrontSideNavFilterView. Remove all direct callsites so I can clean it up.

This is a precursor to letting me render a filter menu as a dropdown menu for T1960.

Test Plan:
Examined each interface for correct filter construction and selection:

  - Browsed Diffusion
  - Browsed Differential
  - Browsed Files
  - Browsed Slowvote
  - Browsed Phriction
  - Browsed repo edit interface

Grepped for `AphrontSideNavView`. The only remaining instances are in `AphrontSideNavView` itself and `AphrontSideNavFilterView` (which currently uses it).

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T1960

Differential Revision: https://secure.phabricator.com/D4034
2012-12-07 13:30:31 -08:00
Bob Trahan
8a6e82eba6 more fixes to fluid diff
Summary: always render "copy" column for text. this gives us consistent left alignment. also tweak css to be less wide for the copy and code coverage columns.

Test Plan: http://phabricator.dev/rP1a3bf098ae4ab4f8add4af744a6b93a257851fb0 looks even better

Reviewers: vrana, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2005

Differential Revision: https://secure.phabricator.com/D4110
2012-12-07 12:37:11 -08:00
Bob Trahan
1922590f98 fix fluid diff change
Summary: when we had a change that had new data and uncommitted changes the colspan could get off. make sure to only decrement the colspan if we are actually on a new line

Test Plan: http://phabricator.dev/rP1a3bf098ae4ab4f8add4af744a6b93a257851fb0 now looks good on Firefox

Reviewers: vrana, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2005

Differential Revision: https://secure.phabricator.com/D4109
2012-12-07 12:00:28 -08:00
epriestley
210f8e0390 Fix leftover call to renderRightCode() from D4083
See T2165.

Auditors: btrahan
2012-12-07 08:16:47 -08:00
Bob Trahan
b4de56ef4b make differential use fluid width for code layout
Summary:
assume at least 360px for a given code pane. that's about when the comment box starts fighting back anyway. we'll use the yet-to-be-built one page render for the narrow viewport cases.

This address the cases as laid out in T2005. It fails the "MMMMM" case pretty horribly. However, if there is a space it works just fine and presumably folks are stretching out their windows on big glorious monitors at 160 characters wide or whatever.

Re-factored things just a tad but figure I'll take a nice big chunk of "renderer" to move forward T2009

Test Plan: looked at all sorts of funky diffs

Reviewers: epriestley

Reviewed By: epriestley

CC: chad, aran, Korvin

Maniphest Tasks: T2005

Differential Revision: https://secure.phabricator.com/D4083
2012-12-06 11:33:04 -08:00
vrana
86470e7a30 Handle empty lines in makeChangesWithContext()
Summary: Happens on the end of hunk.

Test Plan:
  $ ./reparse.php

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4091
2012-12-06 10:43:45 -08:00
vrana
27785c4f75 Don't delete tasks attached by freeform fields in Maniphest Tasks field
Summary: I didn't catch this issue at D3986 because we don't have `DifferentialManiphestTasksFieldSpecification` in field selector.

Test Plan:
Added `DifferentialManiphestTasksFieldSpecification` too field selector.
Wrote `Refs T4` and not filled `T4` to Maniphest Tasks field.

Reviewers: epriestley, 20after4

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T945

Differential Revision: https://secure.phabricator.com/D4073
2012-12-03 16:28:19 -08:00
vrana
bff795d848 Allow disabling editing multiple files at once
Summary: Resolves T2095.

Test Plan:
Saved it, button disappeared.
Saved it back, button appeared.

Reviewers: epriestley, aran

Reviewed By: epriestley

CC: Korvin

Maniphest Tasks: T2095

Differential Revision: https://secure.phabricator.com/D4071
2012-12-03 16:02:52 -08:00
vrana
fc8d8b6f8c CC users mentioned in revision fields
Summary:
Users are used to this feature from comments.
Provide it also in title, summary and test plan.
It adds the users to CC only on creating the revision to avoid cases like:
"I mentioned this user but now I want to remove him from CC" or he unsubscribes.

Test Plan: Wrote `@epriestley` to summary.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4050
2012-11-29 10:14:30 -08:00
Ricky Elrod
416d26b621 Allow users to set whether or not textareas are monospaced.
Summary:
Some users like monospaced textareas and others don't.
This introduces an option to set this as a user preference.

Test Plan: Enabled and saw monospaced textareas, disabled and saw non-monospaced textareas.

Reviewers: epriestley

CC: aran, Korvin

Maniphest Tasks: T2114

Differential Revision: https://secure.phabricator.com/D4037
2012-11-27 14:06:42 -08:00
vrana
4d7b441834 Don't skip even lines in copied code detector
Summary: PHP 3 basics: `each()` advances internal pointer so calling `next()` is wrong.

Test Plan: New test.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4011
2012-11-21 16:34:53 -08:00
vrana
97a97f5376 Attach mentioned Maniphest task also to revision
Summary: Also disable this feature without 'maniphest.enabled'.

Test Plan:
Wrote "fixes T..." in `arc diff`, verified that the task is attached.
Add another "fixes T..." in edit revision on web, verified that it was added.
Deleted "fixes T..." in edit revision, verified that the attached task wasn't deleted.

Reviewers: 20after4, epriestley

Reviewed By: 20after4

CC: aran, Korvin

Maniphest Tasks: T945

Differential Revision: https://secure.phabricator.com/D3986
2012-11-21 11:23:47 -08:00
vrana
03aca35cce Create new paths in Differential
Summary: It is used by 'Pending Differential Revisions'.

Test Plan: Created a new file, `arc diff`, looked at this path in Diffusion, saw Pending Differential Revisions.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3991
2012-11-21 11:08:49 -08:00
Wez Furlong
df76ed9545 be careful of received mail object in error cases too
Summary:
we're tracking down a fatal caused by the mandatory
attachments array parameter change in the reply handler and
yo dawg, heard you like to fatal in your fatal.

Test Plan:
internal test scenario with xmail -> phabricator
triggered manually.

Reviewers: nh, vrana, epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D4005
2012-11-20 17:19:26 -08:00
Bob Trahan
1578986590 fix unit test data showing up in diff view
Summary: I am an idiot. :(  D3962 added the full set of properties and I derp'ed this part of the diff up

Test Plan: ask lesliepc16 to take a look

Reviewers: epriestley, vrana

Reviewed By: vrana

CC: lesliepc16, aran, Korvin

Maniphest Tasks: T2091

Differential Revision: https://secure.phabricator.com/D3984
2012-11-19 14:52:01 -08:00
Bob Trahan
5a58d168ed Differential - add unit and lint information to diff view
Summary:
see title. Note that fields that use customs storage don't work because I didn't think it made sense to load a revision object to get that data. Further, we don't have a revision id at some points, so its not clear what does / does not work...?

Also added a link to upsell this diff view as I had trouble finding it.

Test Plan: viewed some diffs

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: chad, aran, Korvin

Maniphest Tasks: T2026

Differential Revision: https://secure.phabricator.com/D3962
2012-11-16 11:48:17 -08:00
vrana
040fac06d4 Refactor freeform field specification
Summary:
I want to attach the task also to revision, not only to commit by mentioning it in summary.
This is a preparation for it, useful by itself:

* One query instead of N.
* Lower CRAP score, yay!

Refs T945.

Test Plan:
My Test Plan is really //plan// this time.
I want to update Phabricator in the minute when I commit this.

Reviewers: 20after4, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T945

Differential Revision: https://secure.phabricator.com/D3873
2012-11-13 11:41:15 -08:00
Bob Trahan
f8737d15ca Differential - special-case "no reviewers" warning to show only for revions that need review
Summary: 'cuz who cares unless you need review?

Test Plan: noted the UI showed up appropriately to my new business logix

Reviewers: epriestley, chad

Reviewed By: chad

CC: aran, Korvin

Maniphest Tasks: T2010

Differential Revision: https://secure.phabricator.com/D3958
2012-11-12 13:35:44 -08:00
Bob Trahan
8ee6cbe1d4 add "author" information to conduit call
Summary: 'cuz we need it in arcanist for T479 to commit as author

Test Plan: verified the return value was correct in conduit

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T479

Differential Revision: https://secure.phabricator.com/D3917
2012-11-09 13:33:58 -08:00
Bob Trahan
73bc34b26d Add support for differential field specifications to be indexed in search
Summary: ...and do so for a few fields -- summary, test plan, and revert plan.

Test Plan: added NATASHA and BULLWINKLE to summary and test plan of existing diff. Diff showed up in search!

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T654

Differential Revision: https://secure.phabricator.com/D3915
2012-11-07 13:31:52 -08:00
Bob Trahan
fabf36a819 add arc unit data to table of contents in diff view
Summary: title

Test Plan: viewed a diff and verified nothing barfed.

Reviewers: vrana, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2026

Differential Revision: https://secure.phabricator.com/D3906
2012-11-06 15:33:56 -08:00
vrana
ef85f49adc Delete license headers from files
Summary:
This commit doesn't change license of any file. It just makes the license implicit (inherited from LICENSE file in the root directory).

We are removing the headers for these reasons:

- It wastes space in editors, less code is visible in editor upon opening a file.
- It brings noise to diff of the first change of any file every year.
- It confuses Git file copy detection when creating small files.
- We don't have an explicit license header in other files (JS, CSS, images, documentation).
- Using license header in every file is not obligatory: http://www.apache.org/dev/apply-license.html#new.

This change is approved by Alma Chao (Lead Open Source and IP Counsel at Facebook).

Test Plan: Verified that the license survived only in LICENSE file and that it didn't modify externals.

Reviewers: epriestley, davidrecordon

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2035

Differential Revision: https://secure.phabricator.com/D3886
2012-11-05 11:16:51 -08:00
Bob Trahan
afae26ad94 robustify Differential and Maniphest mailhandlers wrt attachments
Summary:
a few things

- make the parent mailhandler class not send "blank body" error if you have attachments
- make both differential and maniphest append a list of attachments to the body if any exist
- BONUS - made the cc stuff work in Maniphest

Test Plan: I haven't actually tested this yet. :(  i need to figure out how to send a mail with an attachment from the command-line and figured I'd serve this up first.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2012

Differential Revision: https://secure.phabricator.com/D3868
2012-11-01 15:18:06 -07:00
Bob Trahan
e0b9a63388 make Differential comment panel flexible width and nip a bit at other flexible width issues
Summary:
all sorts of stuff

 - made comment form width flexible
 - made margins element specific rather than part of differential-primary-pane
 - made box elements all veritically align left and right until code stuff
 - re-factored width calculaton stuff a bunch so only the code section has to suffer from max-width calculations; everything else can flex
 - made colspan 3 for rightmost table header element. this is so the "View Options" UI element ends up lining up correctly with the "Show All Lines" element just below

Test Plan: looked at revision view and changeset view and it all looked hot. note I did not test what things looked like with different word wrap values; that should still work given the re-factoring and not re-design here. also toggled haunted panel mode and it looked good.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2006

Differential Revision: https://secure.phabricator.com/D3866
2012-11-01 13:30:37 -07:00
Bob Trahan
ae616e82d3 add a few more email preferences for differential and maniphest
Summary: this makes notifications work better for folks who choose to handle things in Phabricator and not over email

Test Plan: had my test account and "real" account battle each other on a few tasks and divs. Noted that I received emails appropos to the respective settings.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1977

Differential Revision: https://secure.phabricator.com/D3856
2012-10-31 17:11:04 -07:00
Bob Trahan
4edf8ae2fc make "browse in diffusion" action work for commits in branches other than master
Summary: we do this by passing the "seenOnBranches" commit data detail through the stack

Test Plan: browse in diffusion link worked for non-master checkins under git

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1949

Differential Revision: https://secure.phabricator.com/D3853
2012-10-31 14:07:25 -07:00
vrana
3688ac7479 Fix caching for synthetic inline comments
Test Plan: Looked at diff with several different lint errors, saw correct messages in their inline comments.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3827
2012-10-29 09:38:37 -07:00
epriestley
846f01e221 Correct self-review check in Differential
Summary: This check is currently wrong -- the actor is only //coincidentally// the owner (and only most of the time). It also raises at parse time, preventing any user from parsing a message with their own name in the "Reviewers" field. Instead, check against the right owner PHID and raise it only if a revision is available. See https://github.com/facebook/arcanist/issues/54 and next diff.

Test Plan: Tried to add myself as a reviewer to revisions I own via web and Conduit, got rejected. Parsed a message with myself in the "Reviewers:" field, it worked correctly.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3820
2012-10-25 16:27:49 -07:00
epriestley
fdf90b46eb Use modern two-stage markup cache (PhabricatorMarkupInterface) in Differential
Summary:
See T1963 for discussion of the Facebook-specific hack.

Differential currently uses a one-stage cache (render -> postprocess -> save in cache) rather than the two-stage cache (render -> save in cache -> postprocess) offered by `PhabricatorMarkupInteface`. This breaks Differential comments coming out of cache for the lightbox, and makes various other things suboptimal (status of handles like @mentions and embeds are not displayed accurately).

Instead, use the modern stuff.

Test Plan:
  - Created preview comments and inlines in Differential.
  - Edited a Differential inline.
  - Submitted main and inline Differential comments.
  - Viewed and edited Differential summary and test plan.
  - Created preview comments and inlines in Diffusion.
  - Submitted comments and inlines in Diffusion.
  - Verified Differential now loads and saves to the generalized markup cache (Diffusion is close, but main comments still hold a single-stage cache).
  - Verified old Differential comments work correctly with the lightbox.

Reviewers: vrana, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1963

Differential Revision: https://secure.phabricator.com/D3804
2012-10-23 17:33:58 -07:00
epriestley
7749c5abf3 Mark notifications as read in Differential if we also sent an email
Summary: See D3789. Same thing for Differential.

Test Plan: Created a new revision and made a comment. Verified reviewer got popup notifications but the in-app notifications were delivered already marked as read.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1403

Differential Revision: https://secure.phabricator.com/D3790
2012-10-23 12:03:11 -07:00
epriestley
c0b9b6db54 Don't count "\r" or "\n" for purposes of linewrapping text in Differential
Summary: This should all go away at some point when we move to fluid layout, but don't be more annoying than necessary in the meantime.

Test Plan: Meta.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3788
2012-10-22 16:24:22 -07:00
epriestley
67498f3334 Restore phutil_split_lines() to Differential
Summary:
Same as D3759 with a fix:

Previously, we would insert `null` to indicate a line that doesn't exist on one side of a diff, and then implode on "\n", so we'd get "\n" as a result.

In D3759, we'd insert `null` but implode on empty string, and get nothing as a result.

When a placeholder null is present, explicitly insert a newline.

Test Plan: D3759 plus examined a diff with removed lines on the left side prior to new lines on the right side.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3765
2012-10-20 07:24:27 -07:00
epriestley
468aeaef0d Revert "Use phutil_split_lines() in Differential"
This reverts commit f6cb51562e.

This has some bugs in normal diffs that I haven't immediately been able to figure out. I'll reapply it once I sort them out.

Auditors: vrana
2012-10-20 06:42:08 -07:00
epriestley
f6cb51562e Use phutil_split_lines() in Differential
Summary:
  - We currently treat "\r" as a newline, but should not because VCSes do not.
  - We get an extra empty line at the end of diffs created after D3442 because we now retain newlines.
  - Historically we've converted tab pre-cache, but do it post-cache instead so we can add prefs about it, as we should handle it better than we do (e.g., let the user set it to a different width, infer width from comments in the file, expand it to actual tab stops, or show it visually in some way).

Test Plan:
  - Verified diffs no longer have an empty line at the end.
  - Created a diff of a "\r" file and verified it displayed somewhat reasonably. All browsers treat "\r" as a real newline so it's not necessarily perfect, but we can clean that up later. Hopefully these files are exceedingly rare.
  - Created a file with tabs and verified it came out reasonably.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1857

Differential Revision: https://secure.phabricator.com/D3759
2012-10-20 06:13:24 -07:00
epriestley
3a8be549d6 Don't choke on copy-pasted diffs which include commit messages
Summary: If you `git show` and copy/paste it into Differential, we die trying to save the DifferentialChangeset corresponding to the commit message (error: column "filename" can not be null). Instead, drop the message change for raw diffs.

Test Plan: Copy/pasted `git show` into Differential.

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3740
2012-10-19 10:29:19 -07:00
Dereckson
ce2c0543bf DifferentialCommentEditor::alterReviewers is now aware of differential.allow-self-accept setting
Summary: This allows users to add a revision's author as reviewer according Differential configuration using the 'Leap Into Action' form.

Test Plan: Tested on local install.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1885

Differential Revision: https://secure.phabricator.com/D3682
2012-10-12 07:41:45 -07:00
Dereckson
b7b783d771 Allow to push revisions to review by himself to Differential (bug T1879, change 1/2, Differential part)
Summary: Checks if the revision author is in reviewers only if differential.allow-self-accept is false.

Test Plan:
Tested locally pushing revisions with "arc diff" to a Phabricator
server with differential.allow-self-accept at true or false with
myself or not as reviewer.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1879

Differential Revision: https://secure.phabricator.com/D3673
2012-10-12 07:40:11 -07:00
epriestley
29bdc3ffc5 Fix DifferentialRevisionEditor handling of actorPHID after D3645
Summary: `actorPHID` no longer gets set or exists.

Test Plan: Updated a revision without fataling.

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3684
2012-10-11 14:34:16 -07:00
vrana
d6c12b6518 Document rebase background used in Differential
Summary:
Also fixed formatting.
Also linked docs.

Test Plan:
  $ diviner .

Reviewers: epriestley, wez, nh

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3678
2012-10-11 10:01:09 -07:00
Roy Williams
8007d53473 Added a method on FieldSpec to get all diff properties
Summary: We need to be able to query for all properties matching a given pattern, as mentioned in D3676

Test Plan: Loaded Phabricator, ensured diff loaded, ensured field using all properties was able to enumerate them.

Reviewers: vrana, epriestley

Reviewed By: vrana

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3679
2012-10-10 16:54:08 -07:00
vrana
efed12400d Load all diff properties in revision view
Summary:
We need to load all properties with some prefix in one field.
We can't merge them in one property because there will be a race condition for update (we don't have API for load+update+save).

Instead of providing API for this and complicating the code even more, just load everything unconditionally.
It shouldn't waste much bandwith or memory because we use most of the properties anyway.
It also looked overengineered to me.

Test Plan: Displayed revision with fields using diff properties.

Reviewers: epriestley, royw

Reviewed By: royw

CC: aran, royw, Korvin

Differential Revision: https://secure.phabricator.com/D3676
2012-10-10 13:43:21 -07:00
Bob Trahan
d9c6e07f2c If users are on the email to Phabricator, do not send them the Phabricator reply.
Summary: When we receive an email, figure out if any of the other tos and ccs are users. If they are, pass their phids through the stach as "exclude phids" and exclude them from getting the email.

Test Plan: used the various applications (audit, differential, maniphest) and noted emails were sent as expected.

Reviewers: epriestley, vrana

Reviewed By: vrana

CC: aran, Korvin, vrana

Maniphest Tasks: T1676

Differential Revision: https://secure.phabricator.com/D3645
2012-10-10 10:18:23 -07:00
Wez Furlong
1b6eced757 avoid claiming that the source of a file move was unchanged
Summary:
sometimes we show moved files as unchanged, sometimes deleted,
and sometimes inconsistent with what actually happened at the
destination of the move.  Rather than make a false claim,
omit the 'not changed' notice if this is the source of a move.

Background: one of our users was confused by the source of a move
claiming to be unmodified when the destination of the move had
extensive modifications.

There may be a question about the quality of the data we keep/compute
about the changes, so maybe we could do a better or more consistent
job there (may just be nuances of the SCM in use); this approach
just smoothes that out and doesn't require fixing up the status
in pre-existing diffs.

Test Plan:
In the facebook phabricator, D594195#739ace1a and D590020#b97cfcfd
For others, find a diff that has moved files.
For the source of a move, we should now only show the "X moved to Y"
header and not the "unchanged" shield.

Reviewers: nh, vrana, epriestley

Reviewed By: vrana

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3669
2012-10-09 14:16:21 -07:00
vrana
07db53b6f8 Optimize loading draft revisions
Summary:
This is killing us since D3615.

Maybe we should also change `differential_inlinecomment` index <commentID> to <commentID, authorPHID>.

Test Plan: Checked queries at **/differential/** with comment drafts.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3667
2012-10-09 12:01:34 -07:00
epriestley
4b6d3e1be9 Unconditionally enable drag-and-drop uploads for Remarkup text areas
Summary: Make these always work. Notably, this makes them work in Maniphest. Previously this was at odds with stuff fixed in D3651.

Test Plan: Dragged and dropped files into Remarkup in Maniphest.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3652
2012-10-08 13:26:57 -07:00
vrana
22cb8f5d08 Require canonical numbers in routes
Summary:
D03646 works, I don't want it to work.
Theoretically, it can cause us some troubles if we use this string in JS number context where 030 is 24.

Test Plan: D03646, D3646

Reviewers: epriestley, edward

Reviewed By: edward

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3646
2012-10-05 18:07:54 -07:00