In the GWT UI, patch ranges for merge commits can use an individual
numbered parent commit as the base. In URL patch range expressions, this
is indicated by a negative number. For example, a patch range that diffs
the third parent against the fourth revision would be written like ..
-3..4
While PolyGerrit does not yet support showing diffs against specific
parents, it did not recognize such URLs which are valid in the GWT UI,
and would fail when rendering them.
With this change, numbered merge parents in URL patch range expressions
are correctly parsed in router URL patterns. Because they are not yet
supported in the PG UI, negative base patch indices are normalized by
the router to be as if a base was not specified (which results in the
AutoMerge base patch being selected in the current PG UI). In
particular, the patch range expression above would be normalized to
merely "4".
When the time comes to support diffs against specific parents (i.e.
issue 4760) the route normalization (and its test) should be removed,
but the route pattern modifications in this change should remain.
Bug: Issue 7251
Change-Id: I85212a3c9f38851432751654aa4f4832f342fcf1