Uploaded image for project: 'Crucible'
  1. Crucible
  2. CRUC-7920

Crucible ignores logical paths when Diff To option is used

XMLWordPrintable

      Steps to reproduce

      1. Have SVN repository with at least one branch and trunk
        $ svn diff --summarize -r 1:8 file:///tmp/repository/project1/
        A       file:///tmp/repository/project1/branches/branch-1/file
        A       file:///tmp/repository/project1/branches/branch-1
        A       file:///tmp/repository/project1/branches
        A       file:///tmp/repository/project1/trunk/file
        A       file:///tmp/repository/project1/trunk
        
        $ svn log -v  file:///tmp/repository/project1/branches/branch-1/file
        ------------------------------------------------------------------------
        r8 | glewandowski | 2016-12-14 12:26:56 +0100 (Wed, 14 Dec 2016) | 1 line
        Changed paths:
           M /project1/branches/branch-1/file
        ------------------------------------------------------------------------
        r7 | glewandowski | 2016-12-14 12:26:32 +0100 (Wed, 14 Dec 2016) | 1 line
        Changed paths:
           M /project1/branches/branch-1/file
        ------------------------------------------------------------------------
        r6 | glewandowski | 2016-12-14 12:26:14 +0100 (Wed, 14 Dec 2016) | 2 lines
        Changed paths:
           A /project1/branches/branch-1 (from /project1/trunk:5)
        
        Created branch-1
        ------------------------------------------------------------------------
        r5 | glewandowski | 2016-12-14 12:26:03 +0100 (Wed, 14 Dec 2016) | 1 line
        Changed paths:
           M /project1/trunk/file
        ------------------------------------------------------------------------
        r4 | glewandowski | 2016-12-14 12:25:50 +0100 (Wed, 14 Dec 2016) | 1 line
        Changed paths:
           M /project1/trunk/file
        ------------------------------------------------------------------------
        r3 | glewandowski | 2016-12-14 12:25:35 +0100 (Wed, 14 Dec 2016) | 1 line
        Changed paths:
           A /project1/trunk/file
        
      2. Create review
      3. Add content via Explore repositories
      4. Change Add to Review as select to Diffs to ...
      5. Put 5 (or any commit number which was made on trunk)

      Expected behaviour

      Revisions project1/branches/branch-1/file@8 and project1/trunk/file@5 are added to review and diff generates properly between them or meaningful information is presented to a user.

      Actual behaviour

      FishEye ignores logical paths for a file and fails with NPE.

      Potentially the same problem exists for Perforce repositories

      There's a code which handles such situation when a revision is on a tag and completely disregards the situation like here when it's on a branch.
      Code Snippet from com.cenqua.fisheye.svn.db.SvnRevInfoDAO#getRevId

      public int getRevId(Path path, long changesetId) throws DbException {
              int revid = getPureRevId(path, changesetId);
              if (revid == -1 && pathMatcher.isTag(path)) {
                  String tag = pathMatcher.getTag(path);
                  Path logicalPath = getLogicalPath(path);
                  revid = getTaggedPathRevid(logicalPath, tag, changesetId);
              }
              return revid;
          }
      

      Workaround

      If user wants to generate diff to a branch point, simply se Diff to branch point

        1. screenshot-1.png
          109 kB
          Grzegorz Lewandowski
        2. screenshot-3.png
          43 kB
          Grzegorz Lewandowski

              Unassigned Unassigned
              glewandowski Grzegorz Lewandowski
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: