Prolog in Gerrit

170 views
Skip to first unread message

Shawn Pearce

unread,
Jun 6, 2011, 9:31:57 PM6/6/11
to repo-discuss, Martin Fick
I have now made available my fork of Prolog Cafe at [1], [2]. This
fork is embedded in Gerrit for the "canSubmit" function by [3].

Building the fork requires having SWI-Prolog installed on your
workstation to bootstrap the Prolog->Java compiler used by Prolog Cafe
to build itself. If you are building Gerrit Code Review, Maven will
download a pre-compiled Prolog Cafe JAR from our maven repository on
gerrit.googlecode.com, thereby avoiding the SWI-Prolog bootstrap
dependency.


[1] git://android.git.kernel.org/tools/prolog-cafe.git
[2] http://code.google.com/p/prolog-cafe/
[3] https://review.source.android.com/23526

Diego Celix

unread,
Jun 21, 2011, 9:31:35 AM6/21/11
to Repo and Gerrit Discussion
Hi Shawn,

I'm working with Pete Fotheringham trying to implement the new Topic
Review functionality.

Some of last changes in the master branch made the modification
described in [3] in the "canSubmit" function.
As we are working with a new Topic entity, we will need to provide
similar functionality for topics.

The problem is that I'm a little confused about the new implementation
and I don't know if you could give some little advice of the steps we
need to go through to set up a new "canSubmit" function for Topics.

Meanwhile, I will keep reading the code.


Regards,

Diego

Shawn Pearce

unread,
Jun 21, 2011, 10:15:28 AM6/21/11
to Diego Celix, Repo and Gerrit Discussion
On Tue, Jun 21, 2011 at 06:31, Diego Celix <diego...@codethink.co.uk> wrote:
> I'm working with Pete Fotheringham trying to implement the new Topic
> Review functionality.
>
> Some of last changes in the master branch made the modification
> described in [3] in the "canSubmit" function.
> As we are working with a new Topic entity, we will need to provide
> similar functionality for topics.
>
> The problem is that I'm a little confused about the new implementation
> and I don't know if you could give some little advice of the steps we
> need to go through to set up a new "canSubmit" function for Topics.

A topic branch is a series of changes that need to be submitted
together, or not.

To determine if a topic branch can be submitted, isn't the logic something like:

for (Change change : changesInTopic) {
ChangeControl cc = changeControlFactory.controlFor(change);
cc.canSubmit();
}

That is, run the ChangeControl's canSubmit() logic to determine if the
change by itself is submittable. If all of the changes in the topic
are submittable, than so is the topic. Of course there is a recursive
definition here, a change shouldn't be submittable unless its topic is
submittable, so you may need to have a slightly modified version of
canSubmit on the change level that skips checking the containing
topic's submit status, or just ensure at a higher level that a change
on a topic cannot be submitted unless the topic is being submitted.

Diego Celix

unread,
Jun 21, 2011, 1:05:40 PM6/21/11
to Repo and Gerrit Discussion
Thanks Shawn,

You pointed me to the right direction. It isn't so complicated as I
thought it will be in a first moment. As you say, we must stay in a
higher level.

The thing I need to do is to fill the new SubmitRecord class to get
everything working back to normal.


Thanks again,

Diego

On Jun 21, 2:15 pm, Shawn Pearce <s...@google.com> wrote:
Reply all
Reply to author
Forward
0 new messages