Hi Dana,

We specifically avoid this for a few reasons.

1) It's much more efficient to store a diff in the database instead of a
full file.

2) We need both an original, unmodified file along with the patched file.
This means that either we still need to do a server fetch, or we now need
both files uploaded and stored in the database.

3) It actually limits us. By having the diff, future extensions to Review
Board may be able to do things like track a patch's freshness (useful for
contributed patches to open source projects) by periodically attempting to
apply the patch to the latest version in a codebase. If we use full files,
we can't build this kind of extensibility.

4) Review Board now needs to know how to generate every kind of diff we
could possibly need for every revision control system when the user clicks
Download Diff. We want to preserve the diffs uploaded. For example, A Git
diff may contain some author and description information embedded in the
diff. We can't reproduce this.

There's no reason today why we can't build the functionality to download the
modified files. It's just a matter of looking up the list of files
associated with a change and calling our existing function to grab the
patched version of the file from the repository, then assemble them into a
zip or something for download.

Christian

-- 
Christian Hammond - chip...@chipx86.com
Review Board - http://www.review-board.org
VMware, Inc. - http://www.vmware.com


On Tue, Sep 22, 2009 at 3:37 PM, Lacoste, Dana (TSG Software San Diego) <
dana.laco...@hp.com> wrote:

>  How hard would it be to take upload #1 below and change it to "upload the
> whole file" instead of just the diff: it appears that the RB server is going
> to generate its own diffs anyways, isn't it?
>
>
>
> That would have the added advantage of allowing me (in theory) in the
> future to download that file (rather than just the diff generated from it.)
>
>
>
> It would also simplify some of the following parts: the "diff'd" file would
> already be available and so it would not need to be generated....
>
>
>
> Dana Lacoste
>
>
>
> *From:* reviewboard@googlegroups.com [mailto:reviewbo...@googlegroups.com]
> *On Behalf Of *Christian Hammond
> *Sent:* Tuesday, September 22, 2009 2:55 PM
>
> *To:* reviewboard@googlegroups.com
> *Subject:* Re: post-review login issue
>
>
>
> So the upload process goes like this:
>
> 1) post-review generates a diff in a format that Review Board understands
> (usually the SCM's native diff format, but with some additional headers for
> revision information, if the native format doesn't already contain that).
> 2) Review Board will parse the diff and then fetch each file from the
> server to verify the diff is representative of the correct repository and
> revisions.
>
> Then when users view the diff....
>
> 1) Review Board will go through the list of files that were previously
> parsed out and verified.
> 2) We fetch each file from the server (this uses a local memory cache, so
> we may not actually have to actually fetch from the server for this).
> 3) We take the file and store the original for the left-hand side of the
> diff viewer.
> 4) We then take a copy of that file, apply the patch, and use that for the
> right-hand side.
> 5) Our own diff generator code compares the new original and patched files
> and presents data used for rendering the diff viewer.
>
> Doing it this way gives us the ability to show users the entire file,
> instead of just the lines shown in the diff.
>
> Christian
>
> --
> Christian Hammond - chip...@chipx86.com
> Review Board - http://www.review-board.org
> VMware, Inc. - http://www.vmware.com
>
>  On Tue, Sep 22, 2009 at 12:29 PM, Hui Lin <hui....@bankofamerica.com>
> wrote:
>
>
> I am confused here. What does the diff uploading performed by the post-
> review script actually do? Does the script post the diff it generated
> to the review board server? If so, what's the use of the posted diff,
> if the diff display still needs to fetch everything from perforce?
>
> Also, how could I verify that the diff is loaded into review board
> server?
>
>
>
> On Sep 21, 10:58 pm, Christian Hammond <chip...@chipx86.com> wrote:
> > We verify the files server-side on upload, and this requires pulling them
> > from the repository. Due to some bug with p4python or something (I don't
> > remember the exact cause) we directly call p4 to fetch the file. We then
> use
> > p4 later on to fetch the files for side-by-side display in the diff
> viewer.
> >
> > Christian
> >
> > --
>
> > Christian Hammond - chip...@chipx86.com
> > Review Board -http://www.review-board.org
> > VMware, Inc. -http://www.vmware.com
> >
>
> > On Mon, Sep 21, 2009 at 8:55 PM, Hui Lin <hui....@bankofamerica.com>
> wrote:
> >
> > > I believe uploading the diff is just a reviewer board function, which
> > > doesn't seem to have anything to do with to p4.
> >
> > > On Sep 21, 7:15 pm, Christian Hammond <chip...@chipx86.com> wrote:
> > > > Hi,
> >
> > > > I don't personally have a good answer to the P4PASSWD issue, but
> there
> > > are
> > > > several good Perforce administrators on this list who can probably
> share
> > > > some advice for this.
> >
> > > > As for the error during posting, this is likely due to not having
> p4.exe
> > > > installed in the path where the web server can see it. There's a bug
> open
> > > > for catching this during repository configuration so it's not so
> > > confusing.
> > > > We're planning to add that for 1.1. For now, though, just put p4.exe
> some
> > > > place where the web server can see it in the PATH and it should work.
> >
> > > > Christian
> >
> > > > --
> > > > Christian Hammond - chip...@chipx86.com
> > > > Review Board -http://www.review-board.org
> > > > VMware, Inc. -http://www.vmware.com
> >
> > > > On Mon, Sep 21, 2009 at 2:14 PM, Hui Lin <hui....@bankofamerica.com>
> > > wrote:
> >
> > > > > Yes, I solved this issue by putting what returned from "p4 info"
> > > > > exactly to the repository setup. My local p4 was using an alias of
> > > > > what from "p4 info".
> >
> > > > > Then, I bumped against another issue "Perforce password (P4PASSWD)
> > > > > invalid or unset.". Fortunately, I got the answer from the web:
> >
> > >http://www.mail-archive.com/reviewboard@googlegroups.com/msg00183.html
> >
> > > > > It worked. However, I don't feel quite comfortable of this
> approach,
> > > > > as the ticket expires in 12 hours. Is there a better solution?
> >
> > > > > Now, everything works until "post-review" tries to upload the diff,
> > > > > which would fail with the error:
> > > > >    >>> Uploading diff, size: 9777
> > > > >    >>> HTTP POSTing to
> > > > >http://b002481234dc0/api/json/reviewrequests/7/diff/new/:
> > > > > {}
> > > > >    Error uploading diff: One or more fields had errors (105)
> > > > >    >>> {'fields': {'path': ['[Error 2] The system cannot find the
> > > > > file specified']}, 'stat': 'fail', 'err': {'msg': 'One or more
> fields
> > > > > had errors', 'code': 105}}
> > > > >    Your review request still exists, but the diff is not attached.
> >
> > > > > I am using the diffutil from GnuWin32.
> >
> > > > > On Sep 21, 2:50 pm, Christian Hammond <chip...@chipx86.com> wrote:
> > > > > > Yeah, it's a pain. I really do want to improve our repository
> > > comparison
> > > > > > code. Right now we use a direct look-up for efficiency reasons,
> but
> > > if we
> > > > > > cached the results and allowed each repository backend to do its
> own
> > > > > > comparison, we could remove some of these complications.
> >
> > > > > > Christian
> >
> > > > > > --
> > > > > > Christian Hammond - chip...@chipx86.com
> > > > > > Review Board -http://www.review-board.org
> > > > > > VMware, Inc. -http://www.vmware.com
> >
> > > > > > On Mon, Sep 21, 2009 at 12:41 PM, Lacoste, Dana (TSG Software San
> > > Diego)
> > > > > <
> >
> > > > > > dana.laco...@hp.com> wrote:
> > > > > > >  Yeah, this one got me.
> >
> > > > > > > Particularly because what I set for my "$P4PORT" was NOT what
> the
> > > > > server
> > > > > > > returned in `p4 info` (I used an IP address because I've had
> DNS
> > > issues
> > > > > in
> > > > > > > the past, but the server returned its hostname.)
> >
> > > > > > > J
> >
> > > > > > > Dana Lacoste
> >
> > > > > > > *From:* reviewboard@googlegroups.com [mailto:
> > > > > reviewbo...@googlegroups.com]
> > > > > > > *On Behalf Of *Christian Hammond
> > > > > > > *Sent:* Monday, September 21, 2009 12:31 PM
> > > > > > > *To:* reviewboard@googlegroups.com
> > > > > > > *Subject:* Re: post-review login issue
> >
> > > > > > > Make sure that the repository Path field matches *exactly* what
> you
> > > see
> > > > > > > when running 'p4 info'. We do a literal string comparison.
> >
> > > > > > > Christian
> >
> > > > > > > --
> > > > > > > Christian Hammond - chip...@chipx86.com
> > > > > > > Review Board -http://www.review-board.org
> > > > > > > VMware, Inc. -http://www.vmware.com
> >
> > > > > > >  On Mon, Sep 21, 2009 at 10:55 AM, Hui Lin <
> > > hui....@bankofamerica.com>
> > > > > > > wrote:
> >
> > > > > > > Thanks Christian. I resolved the issue by install the 1.0.3
> version
> > > > > > > and re-create the site.
> >
> > > > > > > Now post-review is able to logon the reviewer board server, but
> > > gets
> > > > > > > problem of understanding the "repository_path" of the SCM
> > > (Perforce):
> > > > > > >    >>> Attempting to create review request for 388600
> > > > > > >    >>> HTTP POSTing
> > > > > tohttp://b002481234dc0/api/json/reviewrequests/new/:
> > > > > > > {'repository_path': 'chigfxldwb32:1667', 'changenum': '388600'}
> > > > > > >    Error creating review request: The repository path specified
> is
> > > > > > > not in the list of known repositories (code 206)
> >
> > > > > > > "chigfxldwb32:1667" is the Perforce port, which I have no
> trouble
> > > to
> > > > > > > connect to it through either the p4 command or the P4V GUI
> client.
> >
> > > > > > > What else should be in the "repository path" for Perforce other
> > > than
> > > > > > > the "port" information? Is there a way to find out what
> Perforce
> > > > > > > command has been executed by the reviewer board server?
> >
> > > > > > > On Sep 20, 10:41 pm, Christian Hammond <chip...@chipx86.com>
> > > wrote:
> > > > > > > > Depends. You may just have logging turned off. Go in the
> > > > > Administration
> > > > > > > UI
> > > > > > > > -> Settings -> Logging and make sure it's enabled and being
> store
> > > in
> > > > > a
> > > > > > > > directory writable by the web server.
> >
> > > > > > > > Christian
> >
> > > > > > > > --
> >
> > > > > > > > Christian Hammond - chip...@chipx86.com
> > > > > > > > Review Board -http://www.review-board.org
> > > > > > > > VMware, Inc. -http://www.vmware.com
> >
> > > > > > > > On Sun, Sep 20, 2009 at 5:57 PM, Hui Lin <
> > > hui....@bankofamerica.com>
> > > > > > > wrote:
> >
> > > > > > > > > The apache server was installed to just host the review
> board
> > > > > server,
> > > > > > > > > so I doubt there is another vhost serviced by it. I noticed
> > > that
> > > > > the
> > > > > > > > > logs directory of review board is empty. Is that strange?
> >
> > > > > > > > > On Sep 20, 7:23 pm, Christian Hammond <chip...@chipx86.com
> >
> > > wrote:
> > > > > > > > > > Okay, so Review Board itself is correct. However,
> post-review
> > > is
> > > > > > > somehow
> > > > > > > > > not
> > > > > > > > > > accessing the same server. This may be a configuration
> error
> > > on
> > > > > the
> > > > > > > web
> > > > > > > > > > server. How many other virtual hosts is that server
> serving?
> > > It
> > > > > may
> > > > > > > be
> > > > > > > > > worth
> > > > > > > > > > checking the log files of the other vhosts to find out
> which
> > > site
> > > > > is
> > > > > > > > > > actually serving that. I suspect it's not the Review
> Board
> > > one.
> >
> > > > > > > > > > Christian
> >
> > > > > > > > > > --
> > > > > > > > > > Christian Hammond - chip...@chipx86.com
> > > > > > > > > > Review Board -http://www.review-board.org
> > > > > > > > > > VMware, Inc. -http://www.vmware.com
> >
> > > > > > > > > > On Sun, Sep 20, 2009 at 5:18 PM, Hui Lin <
> > > > > hui....@bankofamerica.com>
> > > > > > > > > wrote:
> >
> > > > > > > > > > > "http://b00237d4f5dc7/reviews/vtm/"; redirect me to the
> > > > > dashboard.
> > > > > > > > > > > Going to "
> > > > > > >http://b00237d4f5dc7/reviews/vtm/api/json/accounts/login/";
> > > > > > > > > > > in the browser returns an empty page.
> >
> > > > > > > > > > > On Sep 20, 6:17 pm, Christian Hammond <
> chip...@chipx86.com
> >
> > > > > wrote:
> > > > > > > > > > > > It sounds like the server isn't configured at that
> URL
> > > > > correctly,
> > > > > > > or
> > > > > > > > > > > > post-review is hitting the wrong IP address/server.
> >
> > > Doeshttp://b00237d4f5dc7/reviews/vtm/redirectyoutothedashboard
> > > > > or
> >
> > > > > > > > > login
> > > > > > > > > > > > page in your browser? What happens when going
> >
> > > > > tohttp://b00237d4f5dc7/reviews/vtm/api/json/accounts/login/inthe
> > > > > > > > > browser?
> >
> > > > > > > > > > > > Christian
> >
> > > > > > > > > > > > --
> > > > > > > > > > > > Christian Hammond - chip...@chipx86.com
> > > > > > > > > > > > Review Board -http://www.review-board.org
> > > > > > > > > > > > VMware, Inc. -http://www.vmware.com
> >
> > > > > > > > > > > > On Sat, Sep 19, 2009 at 9:57 PM, Hui Lin <
> > > > > > > hui....@bankofamerica.com>
> > > > > > > > > > > wrote:
> >
> > > > > > > > > > > > > I was trying to create a post review request with
> the
> > > > > command
> > > > > > > on
> > > > > > > > > > > > > Windows:
> > > > > > > > > > > > >    post-review 388600
> >
> > > > > > > > > > > > > 388600 is the changelist # of perforce.
> >
> > > > > > > > > > > > > The script was able generate the diff but failed on
> > > logon
> > > > > the
> > > > > > > > > review
> > > > > > > > > > > > > board server, its url is:
> > > > > > > > > > > > >    http://b00237d4f5dc7/reviews/vtm/
> >
> > > > > > > > > > > > > The error message showing was:
> > > > > > > > > > > > >    Unable to access
> >
> > >http://b00237d4f5dc7/reviews/vtm/api/json/accounts/login/.
> > > > > > > > > > > > > The host path may be invalid
> > > > > > > > > > > > >    HTTP Error 404: Not Found
> >
> > > > > > > > > > > > > I tried to enter the username / password at the
> > > prompts, as
> > > > > > > well as
> > > > > > > > > > > > > putting them into parameters "--username" and
> > > "--password",
> > > > > but
> > > > > > > > > > > > > neither way worked. I have no trouble logon with
> the
> > > same
> > > > > > > account
> > > > > > > > > on
> > > > > > > > > > > > > the web page.
> >
> > > > > > > > > > > > > What could be wrong?
> >
>
> > ...
> >
> > read more ยป
>
>
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to