Title: [214067] trunk/Tools
Revision
214067
Author
commit-qu...@webkit.org
Date
2017-03-16 13:55:20 -0700 (Thu, 16 Mar 2017)

Log Message

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

Patch by Kocsen Chung <kocsen_ch...@apple.com> 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.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (214066 => 214067)


--- trunk/Tools/ChangeLog	2017-03-16 20:53:42 UTC (rev 214066)
+++ trunk/Tools/ChangeLog	2017-03-16 20:55:20 UTC (rev 214067)
@@ -1,3 +1,21 @@
+2017-03-16  Kocsen Chung  <kocsen_ch...@apple.com>
+
+        Fix quotes around --pretty format git flag.
+        https://bugs.webkit.org/show_bug.cgi?id=169712
+
+        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.
+
 2017-03-16  Alex Christensen  <achristen...@webkit.org>
 
         Clean up WKContentExtension API

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/scm/git.py (214066 => 214067)


--- trunk/Tools/Scripts/webkitpy/common/checkout/scm/git.py	2017-03-16 20:53:42 UTC (rev 214066)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/scm/git.py	2017-03-16 20:55:20 UTC (rev 214067)
@@ -289,7 +289,7 @@
         return str(match.group('svn_revision'))
 
     def native_revision(self, path):
-        return self._run_git(['log', '-1', '--pretty=format:%H', self.find_checkout_root(path)])
+        return self._run_git(['-C', self.find_checkout_root(path), 'log', '-1', '--pretty=format:%H'])
 
     def svn_url(self):
         git_command = ['svn', 'info']
@@ -315,7 +315,7 @@
         return time_without_timezone.strftime('%Y-%m-%dT%H:%M:%SZ')
 
     def timestamp_of_native_revision(self, path, sha):
-        unix_timestamp = self._run_git(['log', '-1', sha, '--pretty="format:%ct"', self.find_checkout_root(path)]).rstrip()
+        unix_timestamp = self._run_git(['-C', self.find_checkout_root(path), 'log', '-1', sha, '--pretty=format:%ct']).rstrip()
         commit_timestamp = datetime.datetime.utcfromtimestamp(float(unix_timestamp))
         return commit_timestamp.strftime('%Y-%m-%dT%H:%M:%SZ')
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to