[cmake-developers] [PATCH] Handling HG Branches and Path Filtering

Ray, Seoras Seoras-Ray at idexx.com
Thu Apr 2 17:19:47 EDT 2015


We ran into issues with CDash reporting incorrect 'Update' counts and listing incorrectly modified files. This was caused by our Mercurial repo structure, namely a single repository with multiple projects as parent folders (a submodule type structure) and the use of Named branches (hgflow).



The attached patch attempts to fix these problems by accepting a 'branch' parameter to filter the 'hg log' command so that only commits associated with the 'default' or specified branch are shown. In addition when Mercurial branches are merged to default the hg log 'files' template field is not populated (due to a merge applying commits that were previously made). Mercurial notes the modified files in the 'file_mods' template field instead. This patch will look for paths in 'file_mods' and add them if they do not already exist in 'files'. Finally we only wanted to see updates to files that were within the module being built. This patch adds the ability to filter out any modified files not within a specified path.



The following CTest variables have been added:
 * CTEST_VC_MODULE_PATH: Optional path to filter modified files by.
 * CTEST_HG_LOG_BRANCH: Branch name to restrict hg log output to. If not set this defaults to 'default'.



Example Usage:



Repo Structure:
  - /project1
     - files ...
  - /project2
     - files ...



CTEST_VC_MODULE_PATH=project1
  - Do not count or show modified files under /project2



I am not a c++ developer so apologies if the code is not very good, hopefully the ideas if not the actual code will be added to a future release.



Thanks,



Seoras.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150402/d2cd9d4c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake-hg-branch_git.patch
Type: application/octet-stream
Size: 6821 bytes
Desc: cmake-hg-branch_git.patch
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150402/d2cd9d4c/attachment-0001.obj>


More information about the cmake-developers mailing list