Instead of caching downloaded files in `./buck-cache` in the
working folder, cache them in `.gerritcodereview/buck-cache` in
the user's home folder.
This offers two advantages:
- Cached files are not lost if the working folder is removed, or
untracked files are removed with `git clean`.
- The same cached files can be shared between multiple working
folders, i.e. if the developer has separate workspaces to work
on different target branches.
Change-Id: I3e132df85c43431c2454421b1de0d9e901679540
The metaVar used in @Option annotations was not being respected.
Use this value before asking the handler for its default value.
Change-Id: If0193983b9ebbb646ac325f28fefcb667b4f5bec
A new branch can be created by PUT on
'/projects/<project-name>/branches/<ref>.
The WebUI was adapted to use this new REST endpoint to create branches.
The old RPC for creating a branch in ProjectAdminService was deleted.
Change-Id: Id94bc4737eedde383507c7c567b3b6b102b105c5
Instead of exiting with a python stack trace, catch the error and
print a formatted error message, then exit with error code.
Change-Id: I5935ed46e71cdba4e28c06291a9f009e83f20536
If creating the cache directory fails, it is reported as a failure
to run curl.
Separate the error handling and print an appropriate error message.
At the same time, remove redundant calls to `str()` when printing
error messages.
Change-Id: Id6f2c76b16b3101f800cc194a5cb0c2875c4414a
The local.properties file must currently be placed in the root of the
gerrit project. If the project is removed or untracked files are
removed, the settings are lost.
Add support for keeping the file in the `.gerritcodereview` folder in
the user's home folder.
If the file exists in both the gerrit root and `~/.gerritcodereview`,
the one in the root takes precedence.
Change-Id: I815637cf47e84d29c33afa8aafa562d6915f5326
java_library() targets must now list every dependency they need for
an import. This permits buck to run more targets in parallel as it
has a better view of the dependency graph, and opens the door for
buck to make even more optimizations in the future.
Change-Id: I132bf47a725e44ba5950ba6ca76bfa72c3876906
If 'If-None-Match: *' is specified this should only fail if the
specified REST resource already exists and not if the parent resource
exists.
Change-Id: I299ff4cdcd4d932401507eaca4f5807718be6dcd
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Add links to the buck documentation for Eclipse integration and
running the acceptance tests.
Also make the section titles and IDs consistent between the Maven
and Buck pages.
Change-Id: I5ea5f145081b075111e09a2bd15538dfbb41aae3
Make sure all trailing slashes are removed from the canonical
web URL, so that when the message is built it does not end up
with double slashes in the middle.
Change-Id: Ibcd1caf21727e0672f9d840b0371c413f01c083d
* stable-2.7:
Bump openid4java dependency to 0.9.8
Provide direct link to REST API documentation
init: Gracefully handle missing browser
Improve explanation of path conflicts in project config doc
init: Don't set username on upgrade if database.type is JDBC
Change-Id: Ia48eb8428588b598cb10a9ed1d4079a6abf42580
* stable-2.6:
Bump openid4java dependency to 0.9.8
Provide direct link to REST API documentation
init: Gracefully handle missing browser
Improve explanation of path conflicts in project config doc
init: Don't set username on upgrade if database.type is JDBC
Enabling support for cherry picking a change as a
new patchset onto an existing change if the changeid
would already exist on the destination branch. This will
more closely match the expected behaviour compared to
carrying out the same actions from the command line
and pushing to Gerrit.
Change-Id: I7d73386fc449cf5c41d2817642c346de52ab17fd
Some features (e.g. cherry-pick) may want to insert a ChangeMessage
into another Change than the destination Change.
By allowing us to pass a ChangeMessage to insertPatchSet(), we
can setup the destination before injecting the message into the
DB.
Change-Id: I28332c92fee4f95c44e18d400afe70aab022cbbc
GET on /projects/<project-name>/branches/<branch-id> retrieves a
branch.
Change-Id: I1c2c81dcc5292d644d8048436c142039a4274e32
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
The REST API is a first-class feature that we want to
encourage people to use. Providing a high-level link
helps increase visibility.
Change-Id: I5af19d7d9fee1ae2ba67352f2c06cedfb4f8a9f6
GET on /projects/<project-name>/branches returns a list with the
branches of the project.
Change-Id: Ic30e4fc563799e9a4352c4ed01c4db5316abb835
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Gerrit might be installed on a headless server that does not have a
browser installed, or has a browser binary but no X11 server is
configured in the environment. Handle these installations by telling
the user the browser could not be opened and request opening the URL.
Bug: issue 1898
Change-Id: I17c47ac8eb390a5d89db52ad023612b8738dde7d
Previously it also setup the prebuilt_jar() which isn't actually
necessary to execute the download. This reduces the size of the
command line passed into the child buck process.
Before this change not all libraries were downloaded during the
download target. Targets in the root of //lib were skipped due to
an incorrect regex passed to egrep. This has been fixed with the
new regex inside of download_all.py.
The initial binary download now requires ~59s on my home cable modem,
and pulls 84M.
Source JARs are now only downloaded when the user builds the
download_sources target. This saves ~30s of setup time on a
the same connection and reduces the initial download by 16M.
Change-Id: Ie3bc97c9101c94f8bc4b89664bbd218323ad7230
ef38c071627cfa9872c214cb07973ab53bb03f3c renamed Patches to Files. This
rename should be also reflected in the documentation.
Change-Id: I8a6254f72fd3d77297e578243b1bf43871170f95
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Missing import of `symlink` from the `os` module causes an error:
Traceback (most recent call last):
File "/work/gerrit/tools/download_jar.py", line 108, in <module>
symlink(cache_ent, args.o)
NameError: name 'symlink' is not defined
Change-Id: Ie0d6b6dbdd211f830a4443c98bd5ea3b3ab56e3e
Developers may now request buck to use a local mirror by setting
the URL into local.properties, a file already ignored under the
current buck build process, e.g.:
download.GERRIT = http://nexus.my-company.com/
download.MAVEN_CENTRAL = http://nexus.my-company.com/
To support this usage buck now passes to download_jar.py only the name
of the repository in the URL. download_jar parses local.properties
(if present) and replaces the "MAVEN_CENTRAL:" prefix with the URL
supplied by the user.
Because the URL can vary cache entries in buck-cache are now using the
SHA-1 we expect/verify against, instead of the SHA-1 of the URL. This
makes it easier to find a specific JAR in the cache. The artifact,
version and SHA-1 as named in the maven_jar() rule are the strings
used in the file name in buck-cache.
If no SHA-1 verification happens (e.g. source attachment JARs that
are not included into the build) then sha1(canonical_url) is used.
Here the canonical URL uses the repository id prefix string, e.g.:
MAVEN_CENTRAL:org/apache/mina/mina-core/2.0.5/mina-core-2.0.5-sources.jar
Change-Id: I5a469ab15fd36b81bf76f6b51e1110dfdcf04c86
When running `buck build release`, the following warnings are emitted:
asciidoc: WARNING: licenses.txt: line 51: missing section: [[Apache1.1]]
asciidoc: WARNING: licenses.txt: line 111: missing section: [[Apache2.0]]
asciidoc: WARNING: licenses.txt: line 365: missing section: [[MPL1.1]]
There are two causes of these warnings.
Firstly, the ID for the Apache 2.0 section in the page is actually
named "apache2" but the generated html is referring to "Apache2.0".
Secondly, asciidoc does not properly generate the HTML if the ID name
contains dots.
Change the name of the Apache 2.0 section ID to "Apache2_0" and modify
the license generation script to replace dots with underscores in the
section names.
Change-Id: I8ad87d3f8cbd6af5512c0f25079154e5c7982565
Having sources can help with debugging sections of code like launching
a browser during init, or the local cache support that is heavily
based on H2.
Change-Id: Ic06e97066f0daa2fae53374a7dcb755169a88acf
The username may already appear in the url and be working correctly
from a prior installation. Setting database.username will confuse
Gerrit when it tries to connect without a matching database.password.
Bug: issue 1870
Change-Id: Ib25b48bd8587562e56613815f497efab850a80e8