Changeset 214067 in webkit


Ignore:
Timestamp:
Mar 16, 2017 1:55:20 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Fix quotes around --pretty format git flag.
https://bugs.webkit.org/show_bug.cgi?id=169712

Patch by Kocsen Chung <Kocsen Chung> on 2017-03-16
Reviewed by Ryosuke Niwa.

Remove double quotes from command list element '--pretty="format:%ct"' since it will cause
subprocess to not work as expected.
Additionally, take advantage of git -C flag.

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

(Git.native_revision):
Take advantage of git -C flag.
(Git.timestamp_of_native_revision):
Take advantage of git -C flag and remove double quotes from git formatter.
We know this works from committer_email_for_revision() function.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r214061 r214067  
     12017-03-16  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Fix quotes around --pretty format git flag.
     4        https://bugs.webkit.org/show_bug.cgi?id=169712
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Remove double quotes from command list element '--pretty="format:%ct"' since it will cause
     9        subprocess to not work as expected.
     10        Additionally, take advantage of `git -C` flag.
     11
     12        * Scripts/webkitpy/common/checkout/scm/git.py:
     13        (Git.native_revision):
     14        Take advantage of `git -C` flag.
     15        (Git.timestamp_of_native_revision):
     16        Take advantage of `git -C` flag and remove double quotes from git formatter.
     17        We know this works from `committer_email_for_revision()` function.
     18
    1192017-03-16  Alex Christensen  <achristensen@webkit.org>
    220
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/git.py

    r213625 r214067  
    290290
    291291    def native_revision(self, path):
    292         return self._run_git(['log', '-1', '--pretty=format:%H', self.find_checkout_root(path)])
     292        return self._run_git(['-C', self.find_checkout_root(path), 'log', '-1', '--pretty=format:%H'])
    293293
    294294    def svn_url(self):
     
    316316
    317317    def timestamp_of_native_revision(self, path, sha):
    318         unix_timestamp = self._run_git(['log', '-1', sha, '--pretty="format:%ct"', self.find_checkout_root(path)]).rstrip()
     318        unix_timestamp = self._run_git(['-C', self.find_checkout_root(path), 'log', '-1', sha, '--pretty=format:%ct']).rstrip()
    319319        commit_timestamp = datetime.datetime.utcfromtimestamp(float(unix_timestamp))
    320320        return commit_timestamp.strftime('%Y-%m-%dT%H:%M:%SZ')
Note: See TracChangeset for help on using the changeset viewer.