Uploaded image for project: 'FishEye'
  1. FishEye
  2. FE-6262

Blame calculation problem: changelist description or diff can contain diff metadata (Perforce RCS)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 4.4.3, 4.5.1, 4.6.0
    • 3.10.2
    • None
    • None

    Description

      RCS diff parsing can fail if changelist description or added lines contain text that we interpret as RCS metadata, e.g. "change 123 by Author".

      Possible fix could be skipping N lines after an add marker. However, this approach fails when requesting more than one changelist diff in one batch and one of them does not finish with a new line. Then we can get the following output:

      a34 1
      nonummy ligula, et aliquam massa felis dolor.Change 7 by conor@awali on 2008/03/05 04:46:37

      We can't distinguish if "Change 7" is a start of a new changelist, or just a plain text of the added line.
      Currently we treat it as a new changelist, see com.cenqua.fisheye.perforce.client.DescribeProcessor#CHANGE_HEADER. Possible solution is to switch to com.cenqua.fisheye.perforce.client.DescribeProcessor.DescribeType#UNIFIED, but that of course requires testing the new diff format and making sure all supported perforce servers are capable of providing diffs in this format.

      This problem appears for example when parsing https://swarm.workshop.perforce.com/changes/240, file test/p4_describe.good#2. There is a test that currently fails - com.cenqua.fisheye.perforce.client.DescribeProcessorTest#testDescribeDiffsThatContainDiffLikeText:

          @Test
          public void testDescribeDiffsThatContainDiffLikeText() throws Exception {
              doTestDescribe("Change 240 by richard_geiger@rmg:Perforce:utils on 2000/01/03 15:57:06\n" +
                              "\n" +
                              "\tVersion 1.2.5, to account for post-1999 RCS behavior.\n" +
                              "\t(Courtesy of David Simon, Goldman Sachs)\n" +
                              "\n" +
                              "Affected files ...\n" +
                              "\n" +
                              "... //guest/richard_geiger/utils/cvs2p4/test/p4_changes_-l.good#2 edit\n" +
                              "... //guest/richard_geiger/utils/cvs2p4/test/p4_describe.good#2 edit\n" +
                              "\n" +
                              "Differences ...\n" +
                              "\n" +
                              "==== //guest/richard_geiger/utils/cvs2p4/test/p4_changes_-l.good#2 (text) ====\n" +
                              "\n" +
                              "d1 1\n" +
                              "a1 7\n" +
                              "Change 24 on yyyy/mm/dd by rmg@cvs2p4\n" + // this is not 'Changelist 24', but free text
                              "\n" +
                              "\tAdd another rev to check for Y2K handling\n" +
                              "\t\n" +
                              "\t[imported from CVS by cvs2p4 at yyyy/mm/dd hh:mm:ss]\n" +
                              "\n" +
                              "Change 23 on yyyy/mm/dd by rmg@cvs2p4\n" +
                              "\n" +
                              "==== //guest/richard_geiger/utils/cvs2p4/test/p4_describe.good#2 (text) ====\n" +
                              "\n" +
                              "d377 1\n" +
                              "a377 1\n" +
                              "\t[imported from CVS by cvs2p4 at yyyy/mm/dd hh:mm:ss]\n" +
                              "a383 20\n" + // the next 20 lines don't contain RCS metadata, but diff add lines (thus must be treated as free text)
                              "Change 24 by rmg@cvs2p4 on yyyy/mm/dd hh:mm:ss\n" +
                              "\n" +
                              "\tAdd another rev to check for Y2K handling\n" +
                              "\t\n" +
                              "\t[imported from CVS by cvs2p4 at yyyy/mm/dd hh:mm:ss]\n" +
                              "\n" +
                              "Affected files ...\n" +
                              "\n" +
                              "... //depot/Test/main/file#8 edit\n" +
                              "\n" +
                              "Differences ...\n" +
                              "\n" +
                              "==== //depot/Test/main/file#8 (ktext) ====\n" +
                              "\n" +
                              "2c2\n" +
                              "< # $Id: //depot/Test/main/file#7 $\n" +
                              "---\n" +
                              "> # $Id: //depot/Test/main/file#8 $\n" +
                              "10a11\n" +
                              "> Mon Jan  3 hh:mm:ss PST 2000\n" +
                              "\n",
                      ImmutableMap.of(240L,
                              ImmutableMap.of(
                                      "//guest/richard_geiger/utils/cvs2p4/test/p4_changes_-l.good",
                                      ImmutableList.of(
                                              new Hunk(1, 1, 1, 7)
                                      ),
                                      "//guest/richard_geiger/utils/cvs2p4/test/p4_describe.good",
                                      ImmutableList.of(
                                              new Hunk(377, 377, 1, 1),
                                              new Hunk(383, 384, 0, 20)
                                      ))));
          }

      Attachments

        Issue Links

          Activity

            People

              kcichy Kamil Cichy
              kcichy Kamil Cichy
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 0.15h
                  0.15h