My 2 cents, if you want to demo ReviewBoard you really should use a supported SCM.

Adding support for an SCM isn't super hard BUT it isn't super trivial either. There isn't a how-to doc for adding an SCM, you just have to be committed to doing it. I know as I've done it. It really isn't hard but it could take you a few days. I got started by setting up ReviewBoard with Subversion and debugging through the Subversion support to check internal behavior (I probably could have used the test suite but I used a demo site I setup).


ReviewBoard needs original files to apply the diffs/patches too.

One idea I've had is that someone (i.e. not me ;-) ) could implement a fake SCM for ReviewBoard that will parse diffs and create fake files for ReviewBoard to patch. E.g. in scmtools create a new module called fake_unifieddiff.py with a class of FakeUnifiedDiffTool( subclass of SCMTool) and a FakeUnifiedDiffParser(that sub classes DiffParser). FakeUnifiedDiffParser would then process unified diffs and convert into pre patch files and store them (e.g. on the file system). FakeUnifiedDiffTool could then pick up the processed files when ReviewBoard asks for the original file.

E.g.  Consider the following:

    >type \tmp\orig.txt
   This is line 1
   This is line 2
   This is line 3
   This is line 4
   This is line 5
   This is line 6

    >type \tmp\new.txt
   This is line 1
   This is line 2
   This is line 3 which has been changed
   This is line 4
   This is line 5
   This is line 6
   This is line 7

    >diff -u \tmp\orig.txt \tmp\new.txt
   --- \tmp\orig.txt       Tue Jul 20 11:11:05 2010
   +++ \tmp\new.txt        Tue Jul 20 11:11:04 2010
   @@ -1,6 +1,7 @@
    This is line 1
    This is line 2
   -This is line 3
   +This is line 3 which has been changed
    This is line 4
    This is line 5
    This is line 6
   +This is line 7


The fake diff parser would take the diff and try and create as much of the original file as possible to allow patch to succeed. In this example the diff actually has all of the original file visible, but if you have the following:

    >diff -u \tmp\orig.txt \tmp\new.txt -c1
   diff: conflicting specifications of output style
   *** \tmp\orig.txt       Tue Jul 20 11:11:05 2010
   --- \tmp\new.txt        Tue Jul 20 11:11:04 2010
   ***************
   *** 2,4 ****
     This is line 2
   ! This is line 3
     This is line 4
   --- 2,4 ----
     This is line 2
   ! This is line 3 which has been changed
     This is line 4
   ***************
   *** 6 ****
   --- 6,7 ----
     This is line 6
   + This is line 7

Note, not all of the original file is visible (line 5) so I would suggest the fake parser simple create a blank line (you need a line there otherwise the patch will fail).

Issues:

  1. Clearly the limitation of this approach is that you can't expand
     all of the file when reviewing the change like you can with a real
     SCM tool
  2. If you are going to go to all the hassle of creating the fake
     scm/parser you could implement support for your existing SCM with
     the same amount of time/effort (provided you have Python support
     for your SCM already, if you do not you can cheat and spawn
     executables to do the work you need).


Chris

tpinet wrote:
I am in the exact same situation as Erik. I already have a script (on
Windows) that will grab a diff of a shelve set and save to a file on
the local system. If anyone is interested it is "tf diff /
shelveset:<set> /format:unified /ignorespace /ignoreeol > the.diff".
The problem is that I can not move this diff into RB since there is no
TFS Repo support.

I opened http://code.google.com/p/reviewboard/issues/detail?id=1731
this week. I would be willing to pitch in to get some basic support
set up so our Org can use this great tool.

Tim

On Jul 7, 3:12 pm, Erik Bleifield <erikbleifi...@yahoo.com> wrote:
I am seeking to propose using reviewboard at my company. We are one
more TFS shop.

Short of full TFS support, I am attempting to at least demo the
functionality of reviewboard for a group of interested folks.

I have some code files - initial and revisions - copied out to a
directory.

Is it possible to create a diff and upload it to review board without
having reviewboard set to comprehend any source code repository?

What are the steps to do this?

What *specifically* is the patch diff command to generate a properly
formatted diff for reviewboard to understand?

I currently have the current 1.0 release installed on a windows
server.

Thanks,

-----Erik


--
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
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