Commit Graph

24 Commits

Author SHA1 Message Date
Nils Gladitz cc1139cc30 strings: Remove redundant calls to std::string::c_str()
Replacements were detected and performed by the clang tool
remove-cstr-calls on a linux build.
2014-10-15 14:54:05 +02:00
Ben Boeckel 270eb96df0 strings: Remove cmStdString references
Casts from std::string -> cmStdString were high on the list of things
taking up time. Avoid such implicit casts across function calls by just
using std::string everywhere.

The comment that the symbol name is too long is no longer relevant since
modern debuggers alias the templates anyways and the size is a
non-issue since the underlying methods are generated since it's
inherited.
2014-03-08 13:05:35 -05:00
Clinton Stimpson 5730710c86 Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.
Also use SystemTools::Fopen() instead of fopen().
This is to eventually support utf-8 filenames.
2014-01-07 09:27:44 -05:00
Stephen Kelly 4fe963f656 Use new cmHasLiteralPrefix function 2013-11-21 20:53:15 +01:00
Brad King 78b81b773c CTest: Fix ctest_update with 'HEAD' file in source tree
Add the '--' command-line separator to make the HEAD reference
unambiguous.  Extend the CTest.UpdateGIT test to cover this case.
2013-02-28 11:52:30 -05:00
Brad King 732af7fbba CTest: Do not fail with submodules and Git < 1.6.5.0
Several major Linux distributions still do not provide Git >= 1.6.5.0 in
their stable package lists.  Prior to commit 1173cc4a (Update Git
submodules with --recursive, 2011-02-22) CTest was able to use older Git
versions but simply silently failed to update submodules recursively.
Instead of failing with older Git versions preserve the status quo and
add a warning in the update log.  Users testing projects with recursive
submodules may simply update to a Git new enough to support them.
2011-03-10 13:57:30 -05:00
Brad King 1173cc4ab2 CTest: Update Git submodules with --recursive
Fail if submodules exist and the git version is less than 1.6.5.0.

Inspired-by: Johan Björk <phb@spotify.com>
2011-02-22 15:47:50 -05:00
Brad King 5992526482 CTest: Factor out duplicate Git author/committer code
Factor out date/time format code into FormatDateTime function instead of
duplicating it.
2010-12-20 17:16:25 -05:00
Zach Mullen 307b8a6e69 CTest git update should pass the committer as well as the author 2010-12-20 16:05:40 -05:00
Brad King e6067ca969 Merge topic 'ctest-git-flexibility'
a7319cf ctest_update: Run 'git submodule' at top level
7bf8dc1 ctest_update: Support ".git file" work trees
65cb72f ctest_update: Abort if Git FETCH_HEAD has no candidates
2010-08-03 16:07:31 -04:00
Brad King a7319cf1c1 ctest_update: Run 'git submodule' at top level
The git submodule porcelain must be executed from the top level of the
work tree.  Use 'git rev-parse --show-cdup' to find the top level
relative to the source tree.  This is better than searching up the tree
for .git ourselves because it will always work the same way Git does and
thus honors settings like GIT_DISCOVERY_ACROSS_FILESYSTEM.
2010-07-27 11:31:59 -04:00
Brad King 7bf8dc1ac9 ctest_update: Support ".git file" work trees
Commit c3781efb (Support Git upstream branch rewrites, 2010-06-08)
assumed that ".git/FETCH_HEAD" exists inside the source tree.  Fix the
implementation to handle a work tree using a ".git file" to link to its
repository.  Use "git rev-parse --git-dir" to locate the real .git dir.
2010-07-26 11:40:20 -04:00
Brad King 65cb72f758 ctest_update: Abort if Git FETCH_HEAD has no candidates
If .git/FETCH_HEAD provides no merge candidate do not attempt to update.
Also log FETCH_HEAD lines as we parse them since they are essentially
output from the git fetch command.
2010-07-20 16:57:50 -04:00
Brad King bbfe241c6a CTest: Parse empty Git commits correctly
Git's diff-tree format has no '\n'-terminated blank line at the end of
its commit message body block if there are no diff lines.  Instead the
message body is terminated by '\0' and there is no diff section.  Teach
CTest to parse the format in this case.
2010-06-23 09:14:43 -04:00
Brad King c3781efb28 ctest_update: Support Git upstream branch rewrites
Use 'git fetch' followed by 'git reset' to update the source tree.  This
is better than 'git pull' because it can handle a rewritten upstream
branch and does not leave local modifications.  After fetch, parse
FETCH_HEAD to find the merge head that 'git pull' would choose to track
the upstream branch.  Then reset to the selected head.

In the normal fast-forward case the behavior remains unchanged.
However, now local modifications and commits will be erased, and
upstream rewrites are handled smoothly.  This ensures that the upstream
branch is tested as expected.
2010-06-08 16:50:17 -04:00
Brad King 2eae651acc ctest_update: Support custom Git update command
Define CTest configuration variable CTEST_GIT_UPDATE_CUSTOM to set a
custom command line for updating Git-managed source trees.
2010-06-08 16:12:28 -04:00
Brad King d0a1b9efd0 Fix ctest_update log prefix for git submodule update
Commit 67277bac (Teach ctest_update about Git submodules, 2010-05-04)
accidentally logged "git submodule update" with the prefixes "pull-out"
and "pull-err".  Fix it to use "submodule-out" and "submodule-err"
instead.
2010-06-04 17:01:23 -04:00
Brad King 678073bec2 CTest: Submit author email in Update.xml
Add the <Email>...</Email> element in Update.xml for each commit
reported.  This field was defined by Dart but never really used.
Distributed version control systems use author name and email
instead of a user id, so now it makes sense to use this field.
2010-05-07 09:17:26 -04:00
Brad King 67277bacca Teach ctest_update about Git submodules
Git does not automatically checkout the matching version of a submodule
when it checks out a new version of the parent project in the work tree.
If the submodule reference changed in the parent project then we were
reporting the submodule path as a local modification.  Work around the
problem in ctest_update using "git submodule update" after "git pull".
For projects with no submodules this is a no-op.  See issue #10662.
Also add a submodule to the test project for CTest.UpdateGIT to test the
work-around.
2010-05-04 09:40:04 -04:00
Brad King 8bd231866a cmCTestGIT: Refresh index for local modifications
We use 'git diff-index' to detect local modifications after pull.  On
some filesystems the work tree timestamps of a few files may be dated
after the index, making them appear as locally modified.  We address the
problem by using 'git update-index --refresh' to refresh the index and
avoid false local modifications.
2010-02-09 13:31:32 -05:00
Brad King cb27cfb1cc Use human-readable Git commit times in Update.xml
Previously we produced commit times formatted like

  1261403774 -0500

which is what the Git plumbing prints.  Now we use a human-readable
format like

  2009-12-21 15:28:06 -0500

which is still easy to machine-parse.
2009-12-21 10:29:00 -05:00
Brad King 96afb12087 Convert CMake to OSI-approved BSD License
This converts the CMake license to a pure 3-clause OSI-approved BSD
License.  We drop the previous license clause requiring modified
versions to be plainly marked.  We also update the CMake copyright to
cover the full development time range.
2009-09-28 11:43:28 -04:00
Brad King e8e3080ebe COMP: Fix class reference for HP aCC 2009-04-22 10:22:25 -04:00
Brad King 9c17cbeb44 ENH: Teach CTest to handle git repositories
This creates cmCTestGIT to drive CTest Update handling on git-based work
trees.  Currently we always update to the head of the remote tracking
branch (git pull), so the nightly start time is ignored for Nightly
builds.  A later change will address this.  See issue #6994.
2009-04-22 09:19:06 -04:00