Fix dev server configuration

The config option gitiles.basePath was overloaded in [1]
which broke the default behavior of gitiles in dev mode. It used to scan
the path configured via gitiles.basePath to find git repositories.

With [1] it now sets the servlet context path for gitiles to the value
of the same option which doesn't work since the dev mode by default sets
gitiles.basePath to the current working directory which doesn't work
as a servlet context path which results in gitiles returning
"404 Not Found" instead of showing the list of repositories found under
basePath.

Fix this by renaming the option introduced in [1] to
gitiles.contextPath and adapt the documentation accordingly.

[1] I1da95745d1bc8eaa7d5b204a942bcee0b6a027a8

Change-Id: I0f844eaaaadbfd21161e04b915b541a534bbb4a6
diff --git a/Documentation/config.md b/Documentation/config.md
index 869129a..29f328f 100644
--- a/Documentation/config.md
+++ b/Documentation/config.md
@@ -16,6 +16,17 @@
   siteTitle = Acme Inc. Git Browser
 ```
 
+### Base Path
+
+The file system path gitiles will scan for git repositories to serve when started
+in dev mode using `./tools/dev_run.sh`. By default the current working directory
+where the gitiles process was started from.
+
+```
+[gitiles]
+  basePath = /git/
+```
+
 ### URLs
 
 `canonicalHostName`.
@@ -30,7 +41,7 @@
   mode for that file. The link will only appear when you are browsing the file
   at a branch, so the commitish must start with `refs/heads/`.
 
-`basePath` the base path for the gitiles urls. (only applicable for dev mode.)
+`contextPath` the base path for the gitiles urls. Only applicable for dev mode started using `./tools/dev_run.sh`.
 
 > If you are using the Gerrit Gitiles plugin, this is set based on Gerrit's configuration.
 > Default: `null`, do not link `Change-Id` or show edit links.
@@ -40,7 +51,7 @@
   canonicalHostName = gitiles.example.org
   gerritUrl = https://gerrit.example.org/r/
   baseGitUrl = git://git.example.org/
-  basePath = /additional/basepath/for/gitiles/
+  contextPath = /additional/basepath/for/gitiles/
 ```
 
 ### Repositories export
diff --git a/java/com/google/gitiles/dev/DevServer.java b/java/com/google/gitiles/dev/DevServer.java
index f561c52..042dd49 100644
--- a/java/com/google/gitiles/dev/DevServer.java
+++ b/java/com/google/gitiles/dev/DevServer.java
@@ -146,7 +146,7 @@
 
     ServletContextHandler handler = new ServletContextHandler();
     handler.setContextPath(
-        MoreObjects.firstNonNull(cfg.getString("gitiles", null, "basePath"), ""));
+        MoreObjects.firstNonNull(cfg.getString("gitiles", null, "contextPath"), ""));
     handler.addServlet(new ServletHolder(servlet), "/*");
     return handler;
   }