[Cmake-commits] CMake branch, next, updated. v3.7.2-2390-gc610be3

Brad King brad.king at kitware.com
Fri Jan 27 09:27:01 EST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  c610be3c4f698e4fdb3e3272305e381121c8103b (commit)
       via  6c54f7b3655737406c53fa1e4fc1d8f4cc22f9f9 (commit)
      from  51c1863936254a27fb1fe756f2c5c2bcef718422 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c610be3c4f698e4fdb3e3272305e381121c8103b
commit c610be3c4f698e4fdb3e3272305e381121c8103b
Merge: 51c1863 6c54f7b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jan 27 09:27:01 2017 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jan 27 09:27:01 2017 -0500

    Merge topic 'timestamp-percent' into next
    
    6c54f7b3 string: Teach TIMESTAMP to treat %% as %


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6c54f7b3655737406c53fa1e4fc1d8f4cc22f9f9
commit 6c54f7b3655737406c53fa1e4fc1d8f4cc22f9f9
Author:     Bernhard M. Wiedemann <bwiedemann at suse.de>
AuthorDate: Fri Jan 27 14:12:58 2017 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Jan 27 09:25:37 2017 -0500

    string: Teach TIMESTAMP to treat %% as %
    
    This encoding is documented by `strptime`.

diff --git a/Help/command/string.rst b/Help/command/string.rst
index 2c7847a..698a91d 100644
--- a/Help/command/string.rst
+++ b/Help/command/string.rst
@@ -296,6 +296,7 @@ specifiers:
 
 ::
 
+   %%        A literal percent sign (%).
    %d        The day of the current month (01-31).
    %H        The hour on a 24-hour clock (00-23).
    %I        The hour on a 12-hour clock (01-12).
diff --git a/Help/release/dev/timestamp-percent.rst b/Help/release/dev/timestamp-percent.rst
new file mode 100644
index 0000000..046d6c5
--- /dev/null
+++ b/Help/release/dev/timestamp-percent.rst
@@ -0,0 +1,5 @@
+timestamp-percent
+-----------------
+
+* The :command:`string(TIMESTAMP)` command learned to treat ``%%``
+  as a way to encode plain ``%``.
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index 1e5ac5b..3d42e26 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -136,6 +136,7 @@ std::string cmTimestamp::AddTimestampComponent(char flag,
     case 'w':
     case 'y':
     case 'Y':
+    case '%':
       break;
     case 's': // Seconds since UNIX epoch (midnight 1-jan-1970)
     {
diff --git a/Tests/RunCMake/string/Timestamp-stderr.txt b/Tests/RunCMake/string/Timestamp-stderr.txt
index c12b070..653974c 100644
--- a/Tests/RunCMake/string/Timestamp-stderr.txt
+++ b/Tests/RunCMake/string/Timestamp-stderr.txt
@@ -1 +1 @@
-RESULT=2005-08-07 23:19:49 Sun Aug 05 day=219 wd=0 week=32 %%I=11
+RESULT=2005-08-07 23:19:49 Sun Aug 05 day=219 wd=0 week=32 %I=11 epoch=1123456789
diff --git a/Tests/RunCMake/string/Timestamp.cmake b/Tests/RunCMake/string/Timestamp.cmake
index 1232300..d242039 100644
--- a/Tests/RunCMake/string/Timestamp.cmake
+++ b/Tests/RunCMake/string/Timestamp.cmake
@@ -1,3 +1,3 @@
 set(ENV{SOURCE_DATE_EPOCH} "1123456789")
-string(TIMESTAMP RESULT "%Y-%m-%d %H:%M:%S %a %b %y day=%j wd=%w week=%U %%I=%I" UTC)
+string(TIMESTAMP RESULT "%Y-%m-%d %H:%M:%S %a %b %y day=%j wd=%w week=%U %%I=%I epoch=%s" UTC)
 message("RESULT=${RESULT}")

-----------------------------------------------------------------------

Summary of changes:
 Help/command/string.rst                    |    1 +
 Help/release/dev/timestamp-percent.rst     |    5 +++++
 Source/cmTimestamp.cxx                     |    1 +
 Tests/RunCMake/string/Timestamp-stderr.txt |    2 +-
 Tests/RunCMake/string/Timestamp.cmake      |    2 +-
 5 files changed, 9 insertions(+), 2 deletions(-)
 create mode 100644 Help/release/dev/timestamp-percent.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list