92 Commits

Author SHA1 Message Date
Dave Borowitz
292fa154c1 Format all Java files with google-java-format
Having a standard tool for formatting saves reviewers' valuable time.
google-java-format is Google's standard formatter and is somewhat
inspired by gofmt[1]. This commit formats everything using
google-java-format version 1.2.

The downside of this one-off formatting is breaking blame. This can be
somewhat hacked around with a tool like git-hyper-blame[2], but it's
definitely not optimal until/unless this kind of feature makes its way
to git core.

Not in this change:
* Tool support, e.g. Eclipse. The command must be run manually [3].
* Documentation of best practice, e.g. new 100-column default.

[1] https://talks.golang.org/2015/gofmt-en.slide#3
[2] https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/git-hyper-blame.html
[3] git ls-files | grep java$ | xargs google-java-format -i

Change-Id: Id5f3c6de95ce0b68b41f0a478b5c99a93675aaa3
Signed-off-by: David Pursehouse <dpursehouse@collab.net>
2017-02-07 10:04:39 +09:00
David Ostrovsky
fdbfcad77d Remove Buck based build
Bug: Issue 5302
Change-Id: I6e860446ef30ff0ad1c7c49fc0e39d39d921820b
2017-01-23 12:44:58 +00:00
David Ostrovsky
fa18907d7f Bazel: Reformat build files
Reformat the Bazel build files with the buildifier tool [1].

The style is different for Bazel files. Most notably, indentation level
is 4 spaces instead of 2, and " is used instead of '.

[1] https://github.com/bazelbuild/buildifier

Change-Id: I95c0c6f11b6d76572797853b4ebb5cee5ebd3c98
2016-12-07 11:33:07 +00:00
David Ostrovsky
8c9a9ea486 Expose sources in GWT UI plugin API
gwt_binary() uses Bazel feature to retrieve the sources from the
dependency libraries. For the standalone API this feature cannot be
used as the only dependency is GWT UI plugin API. Expose the sources
in GWT UI plugin API as well.

TEST PLAN:

Apply this change and create the plugin API:

  $ ./tools/maven/api.sh install

Apply reviewers plugin Bazel build implementation change: [1] and
verify, that the reviewers plugin can be built with the GWT UI plugin
API created with this change.

[1] https://gerrit-review.googlesource.com/91830

Change-Id: I2b065a8eccbc33020d461834704d684871f463d7
2016-11-22 22:16:18 +00:00
Yuxuan 'fishy' Wang
14fdf9342e bazel: genasciidoc and genasciidoc_zip rule
Implement genasciidoc rule for bazel. It's a filegroup containing all
the html and resource files.

Also implement genasciidoc_zip rule for bazel, which is similar to
buck's genasciidoc rule to produce a zip file containing all asciidoctor
generated and resource files.

TEST PLAN:
  bazel build Documentation
  buck build Documentation:html
  diff -u bazel-bin/Documentation/install.html buck-out/gen/Documentation/html__tmp/Documentation/install.html

Change-Id: I3065355800a982c6956d3bb634204baaa60c045e
2016-10-07 15:20:35 +08:00
David Ostrovsky
b81b4f75ae Implement Bazel build
To run the tests:

  bazel test //...

To build the Gerrit plugin API, run:

  bazel build gerrit-plugin-api:plugin-api_deploy.jar

To build the Gerrit extension API, run:

  bazel build gerrit-extension-api:extension-api_deploy.jar

TODOs:

Licenses
Reduce visibility (all public for now)
Generate HTML Documentation
Core plugins
gerrit_plugin() rule to build plugins in tree and standalone modes
GWT UI (only gwt_module() skylark rule is provided, no gwt_binary())
PolyGerrit UI
WAR
Publish artifacts to Maven Central
Ask Bazel team to add Gerrit to their CI on ci.bazel.io

Contributed-By: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: I9a86e670882a44a5c966579cdeb8ed79b1590de3
2016-06-14 21:12:02 +02:00
David Ostrovsky
08ea694499 Buck: Remove jgit cell
Cross cell support in Buck is considered as experimental feature, with
number of open issues: [1], [2], [3].  Moreover, to make Maven Central
machinery work, it was needed to create symbolic links in source tree.
That broke `buck targets` feature.

Remove it for now, and re-consider to add it later.

[1] https://github.com/facebook/buck/issues/656
[2] https://github.com/facebook/buck/issues/658
[3] https://github.com/facebook/buck/issues/717

Bug: Issue 3954
Change-Id: Ic621a07771f926001df181b46b2169e214ce208a
2016-04-20 22:02:49 +02:00
David Ostrovsky
ff4ee1a494 Remove old unified diff screen
The functionality of skipping deleted or uncommented files when
navigating using the prev / next links will be implemented in a
following change. Note that the diff preferences dialog box currently
doesn't render these settings.

Change-Id: If7549cdd986a5e5dd26b1cbc4b4cfdb7ca48f880
2016-04-03 15:55:12 -04:00
David Ostrovsky
64d4bdf946 Buck: Emulate real JGit project structure in its own cell
I39f2d5d7 isolated jgit in its own cell, that is based on this JGit
Buck build implementation: [1]. Migration was done seamlessly, meant
that single BUCK file in lib/jgit represents JGit cell root location.
However, the real structure of JGit project is divided to number of
different sub-projects. To map between simplified JGit cell in gerrit
and real JGit project structure in JGit project, java_library() rules
were added to root BUCK file in JGit project that work like proxy to
real rules located in JGit sub-projects. For example //:jgit in JGit
tree was implemented as:

  java_library(
    name = 'jgit',
    exported_deps = ['//org.eclipse.jgit:jgit'],
    visibility = ['PUBLIC'],
  )

Such proxies are needed for every artifact that is referenced from
gerrit build and make Buck build implementation unnecessary verbose.
Moreover this introduced some subtle issues, like using JGit
dependencies in context of java_doc rules, where $(location :foo) macro
is unable to resolve the underlying files because java_library with
exported dependencies only do not have association with output file.
An attempt to replace java_library with only exported dependenies with
prebuilt_jar: [2] that depends on the real artifact introduced another
problem with assembly of gerrit.war, because now jgit.jar is twice in
the classpath (because prebuilt_jar has output file association). To
fix this we would need to filter potential duplicates in the assembly
process of gerrit.war.

Instead of using proxy approach and to try to provide yet another
workaround to subtle problems, emulate the JGit project structure and
reference directly the same artifacts paths within gerrit JGit cell
in gerrit build:

  deps = [
    '@jgit//org.eclipse.jgit:jgit',
  ],

This simplifies JGit Buck build implementation, as we wouldn't need to
proxy all artifacts referenced from gerrit build from the root build
file. And this would fix all remaining issues.

This approach make gerrit build slightly more verbose. JGit upgrade
process would need to touch 4 files instead of only one. But given that
the Gerrit/JGit development integration is important feature, we would
like to support (as this integration attempt shows: [3]) in our build
toolchain, this overhead is justified.

With this change, the root build file in JGit project can be stripped:
[4].

[1] https://git.eclipse.org/r/61938
[2] https://git.eclipse.org/r/66547
[3] https://gerrit-review.googlesource.com/61892
[4] https://git.eclipse.org/r/66562

Change-Id: I2d278f80d0fedc4c5e9943804873f57145877dfe
2016-02-14 11:46:49 +01:00
David Ostrovsky
17bb3dbfe8 Buck: Allow to consume JGit from its own cell
Consume JGit as first third party library from its own cell. Normally
the cell is defined as lib/jgit directory. It can be easily replaced
with CLI:

  buck build --config repositories.jgit=path/to/dev/jgit gerrit

or tweaking the .buckconfig:

  [repositories]
    jgit = path/to/dev/jgit

The former approach is sufficient to build and run the test from the
CLI, the latter is needed to generate eclipse project.

To isolate the JGit rules in its own cell some refactoring was needed.
JGit patch for GWT module was moved to gerrit-patch-jgit project, and
some symlinks were needed for maven machinery to work. include_defs()
doesn't work for now across cell boundaries, and native `buck fetch`
feature still has some limitations: [1]. Moreover, excluding paths,
unsigning JARs and license linking should be re-implemented on top
of it.

[1] https://github.com/facebook/buck/issues/602

Test Plan:

Normal gerrit build and the build with hijacked JGit cell should work
in both standalone (gerrit.war) and Eclipse environment. Note, that
to test --config repositories.jgit=path/to/dev/jgit use case, the most
recent JGit tree must be used, that contains Buck driven build
implementation.

Change-Id: I39f2d5d75bbac88804406d6242b5e714f4916926
2016-02-09 00:40:08 +00:00
Urs Wolfer
4ebf42eb2b Remove modifiers 'public' and 'abstract' from interface methods
These modifiers are unnecessary (default for interface methods).

Change-Id: I5ad21dded21059922fb00449ba44e98037311ac4
2015-11-19 09:36:40 -08:00
David Ostrovsky
7d5a771844 Replace ACCOUNT_DIFF_PREFERENCES table with Git backend (part1)
Replace the usage of AccountDiffPreference with a different class in
extension API package.

Data is saved optimized in Git backend: default values are discarded
during save operation and restored during read operation; so that
this optimization step is transparent for the callers.

For example when only one setting, theme in this case, differs from
the default value, only this value is written into diff section in
preferences.config file:

+[diff]
+       theme = eclipse

To support live migration, the upgrade is done in two steps:

* part1 (this change):
  o Always write to both git and db
  o Introduce new configuration option to indicate whether to read from
    git or db, initially set to read from db
  o First binary update: some servers are reading/writing just the db;
    some servers are additionally writing to git
  o After first update: all servers are reading from the db, writing to
    both
  o Batch copy data from db to git (only related to non open source
    Gerrit version)
  o Update all servers to read from git. During the update, some will
    still be reading from the db; that's ok, because everybody is
    writing to git
* part2 (next change):
  o Bump database version, migrate the data from db to git, delete the
    table (and the flag) from the code and update the servers.

Change-Id: I30a6d82f4a8d0c33ae9bb26d7f93c66bd0cb8bee
2015-10-30 11:38:30 +01:00
Edwin Kempin
5d683cc593 Pass ChangeInfo object to extension panels
Instead of the change ID pass the ChangeInfo object to extension
panels of the change screen. This makes all change data available to
the plugin UI code and the plugin doesn't need to load the change data
once more if it is needed.

To make this work the ChangeInfo class must be in a package that is
both visible to the Gerrit client and the plugins. This is why
ChangeInfo and all *Info classes that are imported into ChangeInfo are
moved to gerrit-gwtui-common.

ChangeInfo also uses classes from:

- //lib:gwtjsonrpc
- //lib:gwtorm_client
- //gerrit-common:client
- //gerrit-reviewdb:client

This is why these dependencies are added to gerrit-gwtui-common. They
are exported by gerrit-plugin-gwtui so that they are available to GWT
plugins.

Change-Id: I52d6c5cd68e3c05c66a6d68c2cef10a1df54948f
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2015-08-04 14:05:24 +02:00
Yuxuan 'fishy' Wang
894dd9d103 Pack prettify.min.{js,css} into documentation.
Pack prettify.{js,css} files from gerrit-prettify into the documentation
package as prettify.min.{js,css}.

Bug: Issue 3440
Change-Id: I86585477fc43781768d4883c97c5c275b5bb8760
2015-06-26 00:52:13 +00:00
Shawn Pearce
bd69e3e3ec Add Documentation:js_licenses.txt for JavaScript
//Documentation:js_licenses.txt is an optional target to build
the closure of licenses that are compiled into the JavaScript
by the GWT compiler. This is a subset of what is inside of
licenses.txt, but this subset may be necessary in some cases.

Explicitly break some edges that would otherwise by found
in the build graph to avoid dragging in license information
that is not necessary in the partial report created by the
js_licenses.txt target.

Change-Id: Ibbebb3365faf8dccbcd02ad7ef82280255fc5245
2015-06-25 14:26:07 -07:00
Shawn Pearce
b14bb76d5b Remove //lib/jgit:jgit from UI deps
This should only appear in the server deps.
For UI code build //lib/jgit:edit_lib which
has only the tiny slice of code used in the UI.

Change-Id: Ia46c0559a7180f80fda30efb8884ca236997c92d
2015-06-25 10:03:27 -07:00
David Pursehouse
5ddffa0060 Add missing braces around if- for- and while-statements
Change-Id: Ib7d455426fa78ac803f9d5162466f52b973cf998
2015-03-19 12:15:42 +09:00
Shawn Pearce
f109bec92a Remove references to unsupported IE6
IE6 is no longer supported in target builds by GWT.
Remove the dead code, rename still live IE support to IE8.

Change-Id: I8d0f20ee09a687f2692e196d9f25cef928dc3bb4
2015-03-17 15:47:30 -07:00
David Pursehouse
6d0ebb8ccb Fix some warnings raised by CheckStyle
- Change ordering of 'static', 'final', etc modifiers according to
  the order suggested by JLS.

- Add comments in empty catch blocks for intentionally ignored
  exceptions.

- Add curly braces around if-else blocks.

- Move `catch` to same line as closing brace of preceding `try`
  blocks.

- Wrap long lines.

Note that this change does not fix all instances of the above errors
across the entire code base.

Change-Id: I24bb9649cc5013c249fa5d84e05322a5cdf2ace6
2015-02-12 19:38:30 +09:00
Dave Borowitz
8b42ec5bd5 Turn on many more Eclipse warnings, and fix them
- Warn on empty statements, e.g. "for (;;);". These may be
   typos and are easily replaced by "for (;;) {}" which is more
   explicit.
 - Warn on field hiding. This allows cleanup of many acceptance test
   members, at the cost of a couple of renames and the occasional
   suppression (when the field is in a public nested enum that shadows
   a public constant).
 - Warn on unnecessary casts.
 - Warn on unused declared thrown exceptions. In addition to reducing
   method signature length and number of imports, this also eliminated
   some impossible catch blocks.
 - Warn on missing @Override annotations.
 - Warn on unused parameters. This is likely the most controversial,
   as a few relatively common patterns require unused parameters in a
   way that Eclipse can't ignore. However, it also resulted in cleanup
   of a lot of unnecessary injections and method parameters, so I
   think the cost was worth it.

Change-Id: I7224be8b1c798613a127c88507e8cce400679e5d
2014-10-29 15:00:17 -07:00
David Ostrovsky
76e396b49b Buck: Rename gwtxml to gwt_xml in gwt_module()
gwt_xml is more pythonic naming convention.  Beside that recent Buck
version introduced new gwt_jar parameter in prebuilt_jar() rule and
future Buck versions may introduce gwt_xml parameter to java_library()
rule.

Change-Id: Ia6447e62945ce3eb5ff951421ebf2f0fdf622b3d
2014-05-19 12:26:50 -07:00
David Ostrovsky
834708c8ea Buck: Merge deps and compile_deps parameters in gwt_module() rule
After migration to Buck's own gwt_binary() rule, gwt module libraries
must contain compiled classes. That makes the differentiation between
deps and compile_deps unnecessary.

Change-Id: I26fd741d566709a4d56b6e9623766012279903e4
2014-05-19 18:54:16 +00:00
David Ostrovsky
e73ae61339 Apply "type inference for generic instance creation" Java 7 feature
Change-Id: Ia14802c903ca67b9d94dc6038d70b0e9644bc621
2014-04-26 15:27:57 +02:00
Edwin Kempin
b23a13d4a7 Correct fix for potential NPE in PrettyFormatter
Commit 6eabad25087fa6f1595353078ed933cc43ad7ec8 fixed a possible NPE
in PrettyFormatter but afterwards FindBugs started to report a
potential NPE on a follow-up line.

Change-Id: I18d112e70c6a84f436003932054e6adaa517dae1
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-03-04 11:14:56 +01:00
Edwin Kempin
6eabad2508 Prevent possible NPE in PrettyFormatter
Change-Id: I81893bea2467217a68f199ab8164bb20717a6597
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-02-25 16:34:49 +01:00
David Pursehouse
ae866cd96f Merge branch 'stable-2.8'
* stable-2.8:
  Support committing Lucene writes within a fixed interval
  Fix ArrayIndexOutOfBoundsException on intraline diff again

Conflicts:
	gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneChangeIndex.java

Change-Id: I7b93d81d8e5c53615ef1684b653d6fa9e941d935
2014-02-18 09:58:17 +09:00
Doug Kelly
c58489e934 Fix ArrayIndexOutOfBoundsException on intraline diff again
When using intraline diffs with show line endings, a user could
encounter an ArrayIndexOutOfBoundsException when going from a file
with just newlines to carriage returns and newlines.  This only
impacts the legacy change screen, however.  Since the newline
may be in a span element itself, it looks like we have some more
things to check.

Change-Id: I65443f487be60a949346398a487de38eb88e75dd
2014-02-10 13:37:05 -06:00
Shawn Pearce
05cb053378 Save GWT compile time by avoiding javac
GWT only needs the rebind code for CSS and ServerLinker to be
precompiled as bytecode. Save build time by passing no source
files to the java_library() used by gwt_module().

For a full draft build of ui_safari this cuts the refresh time
down from 32.015s to 26.158s on my MacBook. Saving 6s on each
UI reload adds up during development.

The common annotations need to be provided as bytecode, avoiding
spurious warnings from GWT when there is a Java syntax error.

Change-Id: I37826498650c65c05303e7d4d1177d05781c56f6
2013-11-30 11:06:50 -08:00
Shawn Pearce
72fb6cc514 Remove unused .gitignore
These were necessary only for the Maven based build.

Change-Id: Ie26669e6ccae60a52d2db1b8ad362e2fa88a26f2
2013-11-28 22:56:51 -08:00
David Ostrovsky
c53fd3ae49 Delete eclipse left-over files from the Maven poop era
Change-Id: Ie3a75e8c6a2d274cd39e362259ab20cff474eb8d
2013-11-28 22:55:09 -08:00
Doug Kelly
c4e8ae3291 Update prettify to March 4, 2013 release
Updated version of prettify: in addition to adding new syntax
highlighters, it appears to run much better in IE versions >8.
This would manifest as an unhandled JavaScript exception.

Additionally, formatting appeared to not work well in IE standards
mode and Safari because the @media selector was getting mangled
by GWT.  This was fixed in an update to GWT 2.5.1.

Change-Id: Idcc095dac1007c6794e9f67fa12a92b01695d5cf
2013-09-18 13:06:19 -05:00
Shawn Pearce
93de978e72 Merge branch 'stable-2.7'
* stable-2.7:
  Fix: NullPointerException of dashboard title
  Properly handle double click on external group in GroupTable
  Add plugin repositories section in the pom
  PrettyFormatter: Fix expand tab when syntax coloring is on.
2013-07-05 18:55:30 -07:00
Shawn Pearce
b85c70efc7 Merge branch 'stable-2.6' into stable-2.7
* stable-2.6:
  Fix: NullPointerException of dashboard title
  Properly handle double click on external group in GroupTable
  Add plugin repositories section in the pom
  PrettyFormatter: Fix expand tab when syntax coloring is on.
2013-07-05 18:55:24 -07:00
Shawn Pearce
2c15f68920 Merge branch 'stable-2.7'
* stable-2.7:
  PrettyFormatter: Fix ArrayIndexOutOfBoundException with CRLF files.
  Allow administrators to see all groups
  Correct URL encoding with REST API
2013-07-01 10:20:11 -07:00
Shawn Pearce
e4a159d371 Merge branch 'stable-2.6' into stable-2.7
* stable-2.6:
  PrettyFormatter: Fix ArrayIndexOutOfBoundException with CRLF files.
2013-07-01 10:18:35 -07:00
Arnaud Fabre
a7417cf75d PrettyFormatter: Fix expand tab when syntax coloring is on.
prettify lost support for expanding tabs in r143 [1]. As a consequence,
tab width preference is no longer honored.

Gerrit now handles expanding tabs by itself in all cases, even if syntax
coloring is active.

[1] http://code.google.com/p/google-code-prettify/source/detail?r=143

Bug: issue 1872
Change-Id: I283a3620b1d130d3f66e56d3f202a5122d7a73b8
2013-07-01 17:17:20 +00:00
Arnaud Fabre
4faa7314a4 PrettyFormatter: Fix ArrayIndexOutOfBoundException with CRLF files.
Change I6d82ce322d401743a8de5ab8090b2adc43a909f5 added a workaround for
a bug in prettify, by temporarily adding a space before each \n
character.

For files with CRLF line endings, this means replacing "\r\n" by
"\r<space>\n", which prettify sees as two lines. This leads to a
crash since Gerrit expects a consistent number of lines even after
prettify.

When Show Line Endings is active, the issue does not appear since \r
are replaced with a specific markup, without any actual \r.

Change-Id: I345e332225e449c6f26871476f1a07e67458da59
2013-06-30 18:09:02 +02:00
Shawn Pearce
f252f5348e Gerrit 2.6
Change-Id: I7b6704181bae0953d7de021611ff8e8a0165b93f
2013-06-21 09:51:01 -07:00
David Ostrovsky
dcee57212f Delete Maven based build
The Maven build does not work since the introduction of CodeMirror.
Remove the build until to prevent people from trying to use a broken
build process.  If buck is rejected this commit will be reverted, and
we will attempt to fix the Maven build to include CodeMirror.  If buck
is accepted, we just saved time by avoiding a messy Maven change.

Change-Id: I147d8d1741d52f59de1d2ddce8e5e82583990c14
2013-05-21 20:28:56 -07:00
Shawn Pearce
fd6bb9f6a5 Build with Buck
Implement a new build system using Buck[1], Facebook's
open source clone of Google's internal build system.

  Pros:
  - Concise build language
  - Test and build output is concise
  - Test failures and stack traces show on terminal
  - Reliable incrementals; clean is unnecessary
  - Extensible with simple blocks of Python
  - Fast
      buck: clean: 0.452s, full 1m21.083s [*], no-op:  7.145s,
      mvn:  clean: 4.596s, full 2m53.776s,     no-op: 59.108s,

      [*] full build includes downloading all dependencies,
          time can vary due to remote server performance.

  Cons:
  - No Windows support
  - No native Maven Central support (added by macros)
  - No native GWT, Prolog, or WAR support (added by macros)
  - Bootstrap of buck requires Ant

Getting started:

  git clone https://gerrit.googlesource.com/buck
  cd buck
  ant

  Mac OS X:
    PATH="`pwd`/bin:/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands:$PATH"

  Linux:
    PATH="`pwd`/bin:$PATH"

Importing into Eclipse:

  $ time buck build :eclipse
  0m48.949s

  Import existing project from `pwd`
  Import 'gerrit' (do not import other Maven based projects)
  Expand 'gerrit'
  Right click 'buck-out' > Properties
  Under Attributes check 'Derived'

  If the code doesn't currently compile but an updated classpath
  is needed, refresh the configs and obtain missing JARs:

  $ buck build :eclipse_project :download

Running JUnit tests:

  $ time buck test --all -e slow  # skip slow tests
  0m19.320s

  $ time buck test --all          # includes acceptance tests
  5m17.517s

Building WAR:

  $ buck build :gerrit
  $ java -jar buck-out/gen/gerrit.war

Building release:

  $ buck test --all && buck build :api :release
  $ java -jar buck-out/gen/release.war
  $ ls -lh buck-out/gen/{extension,plugin}-api.jar

Downloading dependencies:

  Dependencies are normally downloaded automatically, but Buck can
  inspect its graph and download missing dependencies so future
  compiles can run without the network:

  $ buck build :download

[1] http://facebook.github.io/buck/

Change-Id: I40853b108bd8e153cefa0896a5280a9a5ff81655
2013-05-09 13:40:36 +00:00
Shawn Pearce
9240c299f0 Begin 2.8
Change-Id: Ie0bc733853be435fba147dd64ef8cbc5a0027ee0
2013-05-06 19:39:10 -07:00
Shawn Pearce
2cdcd9e506 prettify: Move client-only classes to client package
This cleans up a weird dependency in the build tree for any Buck based
build.  Most of these classes are meant only to be compiled for GWT and
do not build at the server side. Maven allowed sloppy use of gwt-user,
making it difficult to identify this earlier.

Change-Id: Id86e74f2f0760c9853829483899379353e5ada13
2013-05-05 19:40:50 -07:00
Dave Borowitz
7f53c5696f Build gwtexpui from in-subtree version
Rename the module and artifact to gerrit-gwtexpui.

Change-Id: Ica1b7aae7777b4188d7d557a9e7fef0c37bca5c7
2013-04-11 14:30:34 -07:00
Shawn Pearce
d47ca8a66d Start 2.7 development
Change-Id: I08dc590bb1f62af67d88eb11313d5d4cfe2423c4
2013-03-21 12:12:47 -07:00
David Pursehouse
6c47edac9e Add clarification comment in SparseFileContent.Range.toString
Change I34fb07f incorrectly "fixed" the brackets in the `toString`
method, however the usage of [ and ) was intentional, to denote that
the range is inclusive/exclusive.

Add a short comment in the method to prevent the same mistake from
being made again.

Change-Id: Idfe9b560c0cc55bfa4a6ab06fba172d971c3089c
2013-02-19 09:58:45 +09:00
Shawn Pearce
0ea71e054e Revert "Non-matching brackets in SparseFileContent.toString()"
This reverts commit 17daae9934941bc6db6b372a04433f19186d5972
The use of ) was intentional as the range is inclusive, exclusive.

Change-Id: I1aa25b6d8a17a374766c6316ee1872c4272e609e
2013-02-19 00:43:04 +00:00
Gustaf Lundh
17daae9934 Non-matching brackets in SparseFileContent.toString()
Change-Id: I34fb07f0e86ded375a160557d4a97ba88e1755c6
2013-02-18 17:02:26 +01:00
Shawn Pearce
7e0aa0b417 Fix performance problem in side by side viewer
Inserting "<lf>\n" doesn't work. Prettify leaves the <lf> but
often inserts a <span> tag between <lf> and \n leaving a very
deep tag stack for the DOM to handle. This is really slow to
render and can cause mis-rendering.

Insert a space before LF. Most prettify styles will treat this
as the same as the LF, allowing the trailing space to be removed
before splitting by line.

Change-Id: I85d12c590a8d1bda1b1b66874a0dddb4628a8655
2013-02-04 16:04:50 -08:00
Shawn Pearce
7c98dd4775 Work around prettify stripping empty lines
Latest prettify build appears to delete empty lines from the end of
the input file. This causes Gerrit to crash with array exceptions
because the formatted HTML is a different length then the diff
hunks indicate.

Work around the broken prettify by inserting a fake HTML tag before
each LF and removing it after formatting is complete.

Change-Id: I6d82ce322d401743a8de5ab8090b2adc43a909f5
2013-02-04 10:16:08 -08:00
Shawn Pearce
dbc896a367 Fix display of Commit Message
If there are no HTML tags in the text, just break on lines.

Change-Id: Ifead11e79af8db2a06c3824b7ab4877e51d2af03
2013-01-31 21:25:59 -08:00