Perforce binary file diff corruption fix

Review Request #915 — Created July 15, 2009 and submitted — Latest diff uploaded

Information

Review Board SVN (deprecated)

Reviewers

When a binary file differed, post-review would miss printing a newline after "Binary Files differ", making the diff invalid for the subsequent file.  This would cause that file's diff to be lost silently when parsed by reviewboard on the server side.  Here's the patch.

 

Diff Revision 2 (Latest)

orig
1
2
/trunk/rbtools/scripts/post-review
/trunk/rbtools/scripts/post-review
Revision 2035 New Change
1659 lines
1660
                    print "Warning: %s in your changeset is unmodified" % \
1660
                    print "Warning: %s in your changeset is unmodified" % \
1661
                        local_path
1661
                        local_path
1662

    
   
1662

   
1663
            dl.insert(0, "==== %s#%s ==%s== %s ====\n" % \
1663
            dl.insert(0, "==== %s#%s ==%s== %s ====\n" % \
1664
                (depot_path, base_revision, changetype_short, local_path))
1664
                (depot_path, base_revision, changetype_short, local_path))

    
   
1665
            dl.append('\n')
1665
        else:
1666
        else:
1666
            m = re.search(r'(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d)', dl[1])
1667
            m = re.search(r'(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d)', dl[1])
1667
            if m:
1668
            if m:
1668
                timestamp = m.group(1)
1669
                timestamp = m.group(1)
1669
            else:
1670
            else:
828 lines
Loading...