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

A patch created on a subsequent local change not yet pushed to the central repository does not anchor to a repository

    XMLWordPrintable

Details

    • Bug
    • Resolution: Answered
    • Low
    • N/A
    • 3.10.2
    • None
    • None

    Description

      Summary

      When using a DCVS repository, in case the user uploads a patch based on a subsequent local change (any change after the first commit not being pushed to the "central repository"), the patch does not anchor.

      Environment

      • DCVS repository, including:
        • Mercurial
        • Git

      Steps to Reproduce

      The steps below refer to a Mercurial repository, but they can be applied to a Git repository as well.

      1. Provided that you have a Mercurial repository with a file in it
      2. Make sure all changes to the repository have been pushed to the central repository so that the hg diff command returns no differences
      3. Change a file in the repository local clone (let's call this change1)
      4. Commit the change (change1) without pushing it to the central repository through the hg commit command
      5. Create a second change in the repository local clone (let's call this change2)
      6. Create a patch file by using the hg diff command
      7. Upload the patch file as a pre-commit in order to create a review

      Expected Results

      The patch anchors successfully to the repository.

      Actual Results

      The patch does not anchor and the following appears in the debug level atlassian-fisheye-YYYY-DD-MM.log file:

      2015-12-11 16:33:05,843 DEBUG [qtp98826337-221 ] fisheye HgCache-resolveRevisionsForPatch - Unknown commit hash: 8ba4e47be4c7
      2015-12-11 16:33:05,847 DEBUG [qtp98826337-221 ] fisheye TxHelperStylePlatformTransactionManager-rollback - Rolled back transaction started from:
      java.lang.Throwable: (Stack trace at transaction depth 0 start)
              at com.cenqua.crucible.hibernate.SessionState.pushTxBeginStacktrace(SessionState.java:71) [fisheye.jar:?]
              at com.cenqua.crucible.hibernate.SessionState.beginTx(SessionState.java:61) [fisheye.jar:?]
              at com.cenqua.crucible.hibernate.HibernateUtil.beginTransaction(HibernateUtil.java:324) [fisheye.jar:?]
      

      Where this is the result of the hg info on the file in the local repository (note the commit hash matching the one in the stacktrace above):

      changeset: 	5:8ba4e47be4c7
      tag:		tip
      user:		test_user
      date:		Fri Dec 11 16:30:55 2015 +11
      summary:	change1
      

      The FishEye user interface shows the following message (where patch3 is the patch name):

      No repository found to anchor patch to
      Crucible tried to anchor your patch to 'patch3', but did not find any matching revisions. You will not be able to do iterative reviews on this patch.
      

      Notes

      The SVN related use case is described in the CRUC-6939 ticket.

      Workaround

      1. Retrieve the commit hash of the last pushed revision by performing the hg log command
      2. When generating the patch, specify the retrieved commit hash:
        hg diff -r c9ef90b58252 > patch1_and_patch2.txt
        
      3. Upload the patch_1_and_patch2.txt

      Attachments

        Activity

          People

            Unassigned Unassigned
            ccurti Caterina Curti
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: