Changeset 143903 in webkit


Ignore:
Timestamp:
Feb 25, 2013 4:26:14 AM (11 years ago)
Author:
rniwa@webkit.org
Message:

run-perf-tests reports wrong commit time
https://bugs.webkit.org/show_bug.cgi?id=110746

Reviewed by Andreas Kling.

The bug was caused by running "svn info" on a subdirectory, which returns a timestamp
of when the subdirectory was last modified.

Run "svn info -r <revision> <repository root>" instead. Specifying revision number is
insufficient since running "svn log -r <revision>" on a partial checkout only returns
an empty result if the revision didn't modify the subdirectory.

For git, there is no partial checkout, so we just need to pass in "-r" option to keep
the interface compatible with svn.

  • Scripts/webkitpy/common/checkout/scm/git.py:

(Git.timestamp_of_latest_commit):

  • Scripts/webkitpy/common/checkout/scm/scm.py:

(SCM.timestamp_of_latest_commit):

  • Scripts/webkitpy/common/checkout/scm/scm_mock.py:

(MockSCM.timestamp_of_latest_commit):

  • Scripts/webkitpy/common/checkout/scm/scm_unittest.py:

(test_timestamp_of_latest_commit):

  • Scripts/webkitpy/common/checkout/scm/svn.py:

(SVN.timestamp_of_latest_commit):

  • Scripts/webkitpy/performance_tests/perftestsrunner.py:

(PerfTestsRunner._generate_results_dict):

Location:
trunk/Tools
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r143898 r143903  
     12013-02-25  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        run-perf-tests reports wrong commit time
     4        https://bugs.webkit.org/show_bug.cgi?id=110746
     5
     6        Reviewed by Andreas Kling.
     7
     8        The bug was caused by running "svn info" on a subdirectory, which returns a timestamp
     9        of when the subdirectory was last modified.
     10
     11        Run "svn info -r <revision> <repository root>" instead. Specifying revision number is
     12        insufficient since running "svn log -r <revision>" on a partial checkout only returns
     13        an empty result if the revision didn't modify the subdirectory.
     14
     15        For git, there is no partial checkout, so we just need to pass in "-r" option to keep
     16        the interface compatible with svn.
     17
     18        * Scripts/webkitpy/common/checkout/scm/git.py:
     19        (Git.timestamp_of_latest_commit):
     20        * Scripts/webkitpy/common/checkout/scm/scm.py:
     21        (SCM.timestamp_of_latest_commit):
     22        * Scripts/webkitpy/common/checkout/scm/scm_mock.py:
     23        (MockSCM.timestamp_of_latest_commit):
     24        * Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
     25        (test_timestamp_of_latest_commit):
     26        * Scripts/webkitpy/common/checkout/scm/svn.py:
     27        (SVN.timestamp_of_latest_commit):
     28        * Scripts/webkitpy/performance_tests/perftestsrunner.py:
     29        (PerfTestsRunner._generate_results_dict):
     30
    1312013-02-25  Jochen Eisinger  <jochen@chromium.org>
    232
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/git.py

    r143833 r143903  
    255255        return str(match.group('svn_revision'))
    256256
    257     def timestamp_of_latest_commit(self, path):
    258         git_log = self._run_git(['log', '-1', '--date=iso', self.find_checkout_root(path)])
     257    def timestamp_of_latest_commit(self, path, revision):
     258        git_log = self._run_git(['log', '-1', '-r', revision, '--date=iso', self.find_checkout_root(path)])
    259259        match = re.search("^Date:\s*(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2}) ([+-])(\d{2})(\d{2})$", git_log, re.MULTILINE)
    260260        if not match:
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py

    r143833 r143903  
    170170        self._subclass_must_implement()
    171171
    172     def timestamp_of_latest_commit(self, path):
     172    def timestamp_of_latest_commit(self, path, revision):
    173173        self._subclass_must_implement()
    174174
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py

    r143833 r143903  
    8585        return '5678'
    8686
    87     def timestamp_of_latest_commit(self, path):
     87    def timestamp_of_latest_commit(self, path, revision):
    8888        return '2013-02-01 08:48:05 +0000'
    8989
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py

    r143833 r143903  
    15831583        scm.find_checkout_root = lambda path: ''
    15841584        scm._run_git = lambda args: 'Date: 2013-02-08 08:05:49 +0000'
    1585         self.assertEqual(scm.timestamp_of_latest_commit('some-path'), '2013-02-08T08:05:49Z')
     1585        self.assertEqual(scm.timestamp_of_latest_commit('some-path', '12345'), '2013-02-08T08:05:49Z')
    15861586
    15871587        scm._run_git = lambda args: 'Date: 2013-02-08 01:02:03 +0130'
    1588         self.assertEqual(scm.timestamp_of_latest_commit('some-path'), '2013-02-07T23:32:03Z')
     1588        self.assertEqual(scm.timestamp_of_latest_commit('some-path', '12345'), '2013-02-07T23:32:03Z')
    15891589
    15901590        scm._run_git = lambda args: 'Date: 2013-02-08 01:55:21 -0800'
    1591         self.assertEqual(scm.timestamp_of_latest_commit('some-path'), '2013-02-08T09:55:21Z')
     1591        self.assertEqual(scm.timestamp_of_latest_commit('some-path', '12345'), '2013-02-08T09:55:21Z')
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/svn.py

    r143839 r143903  
    247247        return self.value_from_svn_info(path, 'Revision')
    248248
    249     def timestamp_of_latest_commit(self, path):
     249    def timestamp_of_latest_commit(self, path, revision):
    250250        # We use --xml to get timestamps like 2013-02-08T08:18:04.964409Z
    251         info_output = Executive().run_command([self.executable_name, 'info', '--xml'], cwd=path).rstrip()
     251        repository_root = self.value_from_svn_info(self.checkout_root, 'Repository Root')
     252        info_output = Executive().run_command([self.executable_name, 'log', '-r', revision, '--xml', repository_root], cwd=path).rstrip()
    252253        match = re.search(r"^<date>(?P<value>.+)</date>\r?$", info_output, re.MULTILINE)
    253254        return match.group('value')
  • trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py

    r143833 r143903  
    246246            revision = scm.svn_revision(path)
    247247            contents[name.lower() + '-revision'] = revision
    248             revisions_for_perf_webkit[name] = {'revision': str(revision), 'timestamp': scm.timestamp_of_latest_commit(path)}
     248            revisions_for_perf_webkit[name] = {'revision': str(revision), 'timestamp': scm.timestamp_of_latest_commit(path, revision)}
    249249
    250250        # FIXME: Add --branch or auto-detect the branch we're in
Note: See TracChangeset for help on using the changeset viewer.