Review Board

beta

post-review for P4win

Updated 2 months, 2 weeks ago

JSlominski Reviewers
reviewboard
None Review Board SVN
I have updated post-review to set the proper perforce environment.  Before P4Tool.txt is imported into P4win, the user needs to enter the path of post-review.  After it is imported they should be able to right click on any change list and by clicking post-review, post a review of the change list in perforce.


 

Diff revision 4 (Latest)

1 2 3 4
1 2 3 4

  1. /trunk/reviewboard/contrib/tools/P4Tool.txt: 1 change [ new content ]
  2. /trunk/reviewboard/contrib/tools/post-review: 3 changes [ 1 2 3 ]
/trunk/reviewboard/contrib/tools/P4Tool.txt
New File
1
P4Win Tools for Review Board
2
>>post-review	python	"<Path of post-review goes here>" %C --p4-client $c --p4-port $p		1	0	1	0	0	1	0		0
/trunk/reviewboard/contrib/tools/post-review
Revision 1457 New Change
801
        except ValueError:
801
        except ValueError:
802
            die("You must enter a valid change number")
802
            die("You must enter a valid change number")
803
803
804
        debug("Generating diff for changenum %s" % changenum)
804
        debug("Generating diff for changenum %s" % changenum)
805
805
806
        # set the P4 enviroment:
807
        if options.p4_client:
808
           os.environ['P4CLIENT'] = options.p4_client
809
810
        if options.p4_port:
811
           os.environ['P4PORT'] = options.p4_port
812
813
806
        description = execute(["p4", "describe", "-s", str(changenum)],
814
        description = execute(["p4", "describe", "-s", str(changenum)],
807
                              split_lines=True)
815
                              split_lines=True)
816
808
        if '*pending*' in description[0]:
817
        if '*pending*' in description[0]:
809
            cl_is_pending = True
818
            cl_is_pending = True
810
819
811
        # Get the file list
820
        # Get the file list
812
        for line_num, line in enumerate(description):
821
        for line_num, line in enumerate(description):
1483
                              help="the parent branch this diff should be "
1492
                              help="the parent branch this diff should be "
1484
                                   "against")
1493
                                   "against")
1485
1494
1486
        tool.add_options(parser)
1495
        tool.add_options(parser)
1487
1496
1497
    if isinstance(tool,PerforceClient):
1498
       parser.add_option("--p4-client",
1499
                         dest="p4_client", default=None,
1500
                         help="the Perforce client name that the review is in")
1501
1502
       parser.add_option("--p4-port",
1503
                         dest="p4_port", default=None,
1504
                         help="the Perforce servers IP address that the review is on")
1505
1488
1506
1489
    parser.add_option("-d", "--debug",
1507
    parser.add_option("-d", "--debug",
1490
                      action="store_true", dest="debug", default=DEBUG,
1508
                      action="store_true", dest="debug", default=DEBUG,
1491
                      help="display debug output")
1509
                      help="display debug output")
1492
1510
  1. /trunk/reviewboard/contrib/tools/P4Tool.txt: 1 change [ new content ]
  2. /trunk/reviewboard/contrib/tools/post-review: 3 changes [ 1 2 3 ]