Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37274

mercurial changelog displays changes from previous commit but not current

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      when running a build, mercurial plugin retrieves changelog of current branch and displays latest changes in that branch.

      Building in workspace /var/lib/jenkins/jobs/it/jobs/sit/workspace
      [workspace] $ hg showconfig paths.default
      [workspace] $ hg pull --rev release
      pulling from /home/hg/it
      no changes found
      [workspace] $ hg update --clean --rev release
      13 files updated, 0 files merged, 0 files removed, 0 files unresolved
      [workspace] $ hg --config extensions.purge= clean --all
      [workspace] $ hg log --rev . --template {node}
      [workspace] $ hg log --rev . --template {rev}
      [workspace] $ hg log --rev 5b974cd24b9c3b650392b430a0e6418aaf60edd6
      changeset:   7030:5b974cd24b9c
      branch:      release
      user:        Justinas Urbanavicius
      date:        Tue Aug 09 11:02:55 2016 +0300
      summary:     Not quoting a scalar starting with the "%" indicator character is deprecated since Symfony 3.1 and will throw a ParseException in 4.0
      

      but the latest commit is actually not latest, the local change id displayed here is 7030, if i run in workspace:
      hg id -i -n
      746e3dd247cc 7031

      so the the latest is being checked out, but displayed changes are tip - 1
      projects changes display the information correctly.
      so currently displayed information is confusing

        Attachments

          Issue Links

            Activity

            Hide
            lesmurphy Les Murphy added a comment -

            We've been getting this as well. We have to run a second job for the log to show up correctly.

            After the commits to Mercurial, the first job shows that the wrong revision # and node are being used. The repository is actually at 468 when these log entries were generated:

            Building remotely on DENQA03 in workspace c:\Jenkins\workspace\GDW All Tests - PROD (Run1)
            [GDW All Tests - PROD (Run1)] $ hg showconfig paths.default
            [GDW All Tests - PROD (Run1)] $ hg pull --rev default
            pulling from http://denqa01:8000/GDWTestAutomation
            searching for changes
            adding changesets
            adding manifests
            adding file changes
            added 8 changesets with 14 changes to 11 files
            (run 'hg update' to get a working copy)
            [GDW All Tests - PROD (Run1)] $ hg update --clean --rev default
            11 files updated, 0 files merged, 0 files removed, 0 files unresolved
            [GDW All Tests - PROD (Run1)] $ hg log --rev . --template

            {node}
            [GDW All Tests - PROD (Run1)] $ hg log --rev . --template {rev}
            [GDW All Tests - PROD (Run1)] $ hg log --rev 781104b8b0c9a4ca4188f347e84407e926ab873f
            changeset: 460:781104b8b0c9
            user: xxxx@xxxx.com
            date: Fri Aug 26 08:43:19 2016 -0600
            summary: Comment From Rev 460

            When we re-run the job, we see that the local repository had already been updated to the current - but now the plugin documents the correct revision:

            Building remotely on DENQA03 in workspace c:\Jenkins\workspace\GDW All Tests - PROD (Run1)
            [GDW All Tests - PROD (Run1)] $ hg showconfig paths.default
            [GDW All Tests - PROD (Run1)] $ hg pull --rev default
            pulling from http://denqa01:8000/GDWTestAutomation
            no changes found
            [GDW All Tests - PROD (Run1)] $ hg update --clean --rev default
            0 files updated, 0 files merged, 0 files removed, 0 files unresolved
            [GDW All Tests - PROD (Run1)] $ hg log --rev . --template {node}

            [GDW All Tests - PROD (Run1)] $ hg log --rev . --template

            {rev}

            [GDW All Tests - PROD (Run1)] $ hg log --rev 16165c769661e9a6a26bc0fcafcb90fbf988a8ce
            changeset: 468:16165c769661
            tag: tip
            parent: 467:8ae5f7410737
            parent: 460:781104b8b0c9
            user: xxx@xxx.com
            date: Fri Aug 26 11:53:13 2016 -0600
            summary: Merge

            Show
            lesmurphy Les Murphy added a comment - We've been getting this as well. We have to run a second job for the log to show up correctly. After the commits to Mercurial, the first job shows that the wrong revision # and node are being used. The repository is actually at 468 when these log entries were generated: Building remotely on DENQA03 in workspace c:\Jenkins\workspace\GDW All Tests - PROD (Run1) [GDW All Tests - PROD (Run1)] $ hg showconfig paths.default [GDW All Tests - PROD (Run1)] $ hg pull --rev default pulling from http://denqa01:8000/GDWTestAutomation searching for changes adding changesets adding manifests adding file changes added 8 changesets with 14 changes to 11 files (run 'hg update' to get a working copy) [GDW All Tests - PROD (Run1)] $ hg update --clean --rev default 11 files updated, 0 files merged, 0 files removed, 0 files unresolved [GDW All Tests - PROD (Run1)] $ hg log --rev . --template {node} [GDW All Tests - PROD (Run1)] $ hg log --rev . --template {rev} [GDW All Tests - PROD (Run1)] $ hg log --rev 781104b8b0c9a4ca4188f347e84407e926ab873f changeset: 460:781104b8b0c9 user: xxxx@xxxx.com date: Fri Aug 26 08:43:19 2016 -0600 summary: Comment From Rev 460 When we re-run the job, we see that the local repository had already been updated to the current - but now the plugin documents the correct revision: Building remotely on DENQA03 in workspace c:\Jenkins\workspace\GDW All Tests - PROD (Run1) [GDW All Tests - PROD (Run1)] $ hg showconfig paths.default [GDW All Tests - PROD (Run1)] $ hg pull --rev default pulling from http://denqa01:8000/GDWTestAutomation no changes found [GDW All Tests - PROD (Run1)] $ hg update --clean --rev default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved [GDW All Tests - PROD (Run1)] $ hg log --rev . --template {node} [GDW All Tests - PROD (Run1)] $ hg log --rev . --template {rev} [GDW All Tests - PROD (Run1)] $ hg log --rev 16165c769661e9a6a26bc0fcafcb90fbf988a8ce changeset: 468:16165c769661 tag: tip parent: 467:8ae5f7410737 parent: 460:781104b8b0c9 user: xxx@xxx.com date: Fri Aug 26 11:53:13 2016 -0600 summary: Merge
            Hide
            kkurasz Kristopher Kurasz added a comment -

            MercurialSCM.determineChanges appears to be logging using 'prevTag' rather than the tip for the current branch. If I check my repository state I see that the repository has been updated to the correct changeset and it is the 'hg log' command that is being passed the prevTag changeset. 'prevTag' is derived from 'baseline' which is passed in to the overridden 'MercurialSCM.checkout' function.

            Note that MercurialSCM.determineChanges is calculating the correct set of changesets and the changelog.xml file that is generated also correct. So, the changeset that the job updates to is correct, the changelog.xml shows the correct list of changesets, but the log message in the jenkins job console output is misleading. The logs suggests that the plugin updated to the baseline changeset rather than tip changeset.

            I would recommend changing the log messages to display:

            1. baseline: %baseline_hash%
            2. working: %tip_hash%
            3. log the basic changeset information for tip, not baseline. (ie. hg log --rev tip)

            Disclaimer
            I am a jenkins user not a jenkins developer. I happen to also be a software developer and I tend to avoid Java. Hopefully my contributions are useful but they should by no means be considered jenkins/java edict.

            --Kris

            Show
            kkurasz Kristopher Kurasz added a comment - MercurialSCM.determineChanges appears to be logging using 'prevTag' rather than the tip for the current branch. If I check my repository state I see that the repository has been updated to the correct changeset and it is the 'hg log' command that is being passed the prevTag changeset. 'prevTag' is derived from 'baseline' which is passed in to the overridden 'MercurialSCM.checkout' function. Note that MercurialSCM.determineChanges is calculating the correct set of changesets and the changelog.xml file that is generated also correct. So, the changeset that the job updates to is correct, the changelog.xml shows the correct list of changesets, but the log message in the jenkins job console output is misleading. The logs suggests that the plugin updated to the baseline changeset rather than tip changeset. I would recommend changing the log messages to display: baseline: %baseline_hash% working: %tip_hash% log the basic changeset information for tip, not baseline. (ie. hg log --rev tip) Disclaimer I am a jenkins user not a jenkins developer. I happen to also be a software developer and I tend to avoid Java. Hopefully my contributions are useful but they should by no means be considered jenkins/java edict. --Kris
            Hide
            jglick Jesse Glick added a comment -

            Text printed to the build log is not the changelog. This is just incidental output from some calculations the plugin is doing.

            To avoid confusion I can make it less chatty.

            Show
            jglick Jesse Glick added a comment - Text printed to the build log is not the changelog. This is just incidental output from some calculations the plugin is doing. To avoid confusion I can make it less chatty.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/hudson/plugins/mercurial/MercurialSCM.java
            src/test/java/hudson/plugins/mercurial/SCMTestBase.java
            http://jenkins-ci.org/commit/mercurial-plugin/92bbec6b7185edf9c2e09ade532a5db368dbc1f6
            Log:
            JENKINS-37274 Misleading to print output about the prevTag—could be mistaken for the changelog of the build.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/plugins/mercurial/MercurialSCM.java src/test/java/hudson/plugins/mercurial/SCMTestBase.java http://jenkins-ci.org/commit/mercurial-plugin/92bbec6b7185edf9c2e09ade532a5db368dbc1f6 Log: JENKINS-37274 Misleading to print output about the prevTag—could be mistaken for the changelog of the build.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/hudson/plugins/mercurial/MercurialSCM.java
            src/test/java/hudson/plugins/mercurial/SCMTestBase.java
            http://jenkins-ci.org/commit/mercurial-plugin/b45f3836bd7fb58b0a7797b89f64f950bb8cfa12
            Log:
            Merge pull request #86 from jglick/quieter-log-JENKINS-37274

            JENKINS-37274 Suppress a confusing bit of output

            Compare: https://github.com/jenkinsci/mercurial-plugin/compare/8063cc0c601e...b45f3836bd7f

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/hudson/plugins/mercurial/MercurialSCM.java src/test/java/hudson/plugins/mercurial/SCMTestBase.java http://jenkins-ci.org/commit/mercurial-plugin/b45f3836bd7fb58b0a7797b89f64f950bb8cfa12 Log: Merge pull request #86 from jglick/quieter-log- JENKINS-37274 JENKINS-37274 Suppress a confusing bit of output Compare: https://github.com/jenkinsci/mercurial-plugin/compare/8063cc0c601e...b45f3836bd7f

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                gameshas Justinas Urbanavicius
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: