scm.cpp revision 739c9e0e5fccb99475b8202ead8fc5665b2fa64c
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * IPRT Testcase / Tool - Source Code Massager.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * Copyright (C) 2010-2012 Oracle Corporation
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * available from http://www.virtualbox.org. This file is free software;
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * you can redistribute it and/or modify it under the terms of the GNU
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * General Public License (GPL) as published by the Free Software
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync/*******************************************************************************
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync* Header Files *
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync*******************************************************************************/
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync/*******************************************************************************
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync* Defined Constants And Macros *
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync*******************************************************************************/
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync/** The name of the settings files. */
0f77dc54d7ec617480988ccdfcd080f480e79698vboxsync/*******************************************************************************
0f77dc54d7ec617480988ccdfcd080f480e79698vboxsync* Structures and Typedefs *
0f77dc54d7ec617480988ccdfcd080f480e79698vboxsync*******************************************************************************/
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync/** Pointer to const massager settings. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsynctypedef struct SCMSETTINGSBASE const *PCSCMSETTINGSBASE;
2c95722bb302f4ce9454d04324b09314c0ccc038vboxsync * SVN property.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsynctypedef struct SCMSVNPROP
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /** The property. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /** The value.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * When used to record updates, this can be set to NULL to trigger the
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * deletion of the property. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync/** Pointer to a SVN property. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync/** Pointer to a const SVN property. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * Rewriter state.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsynctypedef struct SCMRWSTATE
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /** The filename. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /** Set after the printing the first verbose message about a file under
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * rewrite. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /** The number of SVN property changes. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /** Pointer to an array of SVN property changes. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync/** Pointer to the rewriter state. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * A rewriter.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * This works like a stream editor, reading @a pIn, modifying it and writing it
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * to @a pOut.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @returns true if any changes were made, false if not.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @param pIn The input stream.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @param pOut The output stream.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @param pSettings The settings.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsynctypedef bool (*PFNSCMREWRITER)(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * Configuration entry.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsynctypedef struct SCMCFGENTRY
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /** Number of rewriters. */
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync /** Pointer to an array of rewriters. */
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync /** File pattern (simple). */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * Source Code Massager Settings.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /** Only process files that are part of a SVN working copy. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /** Only recurse into directories containing an .svn dir. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /** Set svn:eol-style if missing or incorrect. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /** Set svn:executable according to type (unusually this means deleting it). */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /** Set svn:keyword if completely or partially missing. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /** Only consider files matching these patterns. This is only applied to the
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * base names. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /** Filter out files matching the following patterns. This is applied to base
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * names as well as the absolute paths. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /** Filter out directories matching the following patterns. This is applied
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * to base names as well as the absolute paths. All absolute paths ends with a
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * slash and dot ("/."). */
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync/** Pointer to massager settings. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * Option identifiers.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @note The first chunk, down to SCMOPT_TAB_SIZE, are alternately set &
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * clear. So, the option setting a flag (boolean) will have an even
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * number and the one clearing it will have an odd number.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @note Down to SCMOPT_LAST_SETTINGS corresponds exactly to SCMSETTINGSBASE.
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync * File/dir pattern + options.
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync/** Pointer to a pattern + option pair. */
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync/** Pointer to a settings set. */
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync * Settings set.
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync * This structure is constructed from the command line arguments or any
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync * .scm-settings file found in a directory we recurse into. When recursing in
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync * and out of a directory, we push and pop a settings set for it.
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync * The .scm-settings file has two kinds of setttings, first there are the
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync * unqualified base settings and then there are the settings which applies to a
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync * set of files or directories. The former are lines with command line options.
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync * For the latter, the options are preceded by a string pattern and a colon.
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync * The pattern specifies which files (and/or directories) the options applies
0f77dc54d7ec617480988ccdfcd080f480e79698vboxsync * We parse the base options into the Base member and put the others into the
0f77dc54d7ec617480988ccdfcd080f480e79698vboxsync * paPairs array.
0f77dc54d7ec617480988ccdfcd080f480e79698vboxsynctypedef struct SCMSETTINGS
0f77dc54d7ec617480988ccdfcd080f480e79698vboxsync /** Pointer to the setting file below us in the stack. */
0f77dc54d7ec617480988ccdfcd080f480e79698vboxsync /** Pointer to the setting file above us in the stack. */
0f77dc54d7ec617480988ccdfcd080f480e79698vboxsync /** File/dir patterns and their options. */
0f77dc54d7ec617480988ccdfcd080f480e79698vboxsync /** The number of entires in paPairs. */
0f77dc54d7ec617480988ccdfcd080f480e79698vboxsync /** The base settings that was read out of the file. */
0f77dc54d7ec617480988ccdfcd080f480e79698vboxsync/** Pointer to a const settings set. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync/*******************************************************************************
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync* Internal Functions *
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync*******************************************************************************/
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic bool rewrite_StripTrailingBlanks(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic bool rewrite_ExpandTabs(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic bool rewrite_ForceNativeEol(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic bool rewrite_ForceLF(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic bool rewrite_ForceCRLF(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic bool rewrite_AdjustTrailingLines(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic bool rewrite_SvnNoExecutable(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic bool rewrite_SvnKeywords(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic bool rewrite_Makefile_kup(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings);
0f77dc54d7ec617480988ccdfcd080f480e79698vboxsyncstatic bool rewrite_Makefile_kmk(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic bool rewrite_C_and_CPP(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync/*******************************************************************************
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync* Global Variables *
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync*******************************************************************************/
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsyncstatic bool g_fDryRun = true;
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic bool g_fDiffSpecialChars = true;
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic bool g_fDiffIgnoreEol = false;
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic bool g_fDiffIgnoreLeadingWS = false;
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic bool g_fDiffIgnoreTrailingWS = false;
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync/** The global settings. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /* .fConvertEol = */ true,
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /* .fConvertTabs = */ true,
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /* .fForceFinalEol = */ true,
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /* .fForceTrailingLine = */ false,
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /* .fStripTrailingBlanks = */ true,
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /* .fStripTrailingLines = */ true,
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /* .fOnlySvnFiles = */ false,
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /* .fOnlySvnDirs = */ false,
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /* .fSetSvnEol = */ false,
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /* .fSetSvnExecutable = */ false,
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /* .fSetSvnKeywords = */ false,
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /* .pszFilterOutFiles = */ (char *)"*.exe|*.com|20*-*-*.log",
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync /* .pszFilterOutDirs = */ (char *)".svn|.hg|.git|CVS",
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync/** Option definitions for the base settings. */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--convert-eol", SCMOPT_CONVERT_EOL, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--no-convert-eol", SCMOPT_NO_CONVERT_EOL, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--convert-tabs", SCMOPT_CONVERT_TABS, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--no-convert-tabs", SCMOPT_NO_CONVERT_TABS, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--force-final-eol", SCMOPT_FORCE_FINAL_EOL, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--no-force-final-eol", SCMOPT_NO_FORCE_FINAL_EOL, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--force-trailing-line", SCMOPT_FORCE_TRAILING_LINE, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--no-force-trailing-line", SCMOPT_NO_FORCE_TRAILING_LINE, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--strip-trailing-blanks", SCMOPT_STRIP_TRAILING_BLANKS, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--no-strip-trailing-blanks", SCMOPT_NO_STRIP_TRAILING_BLANKS, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--strip-trailing-lines", SCMOPT_STRIP_TRAILING_LINES, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--strip-no-trailing-lines", SCMOPT_NO_STRIP_TRAILING_LINES, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--only-svn-dirs", SCMOPT_ONLY_SVN_DIRS, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--not-only-svn-dirs", SCMOPT_NOT_ONLY_SVN_DIRS, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--only-svn-files", SCMOPT_ONLY_SVN_FILES, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--not-only-svn-files", SCMOPT_NOT_ONLY_SVN_FILES, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--set-svn-eol", SCMOPT_SET_SVN_EOL, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--dont-set-svn-eol", SCMOPT_DONT_SET_SVN_EOL, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--set-svn-executable", SCMOPT_SET_SVN_EXECUTABLE, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--dont-set-svn-executable", SCMOPT_DONT_SET_SVN_EXECUTABLE, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--set-svn-keywords", SCMOPT_SET_SVN_KEYWORDS, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--dont-set-svn-keywords", SCMOPT_DONT_SET_SVN_KEYWORDS, RTGETOPT_REQ_NOTHING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--tab-size", SCMOPT_TAB_SIZE, RTGETOPT_REQ_UINT8 },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--filter-out-dirs", SCMOPT_FILTER_OUT_DIRS, RTGETOPT_REQ_STRING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--filter-files", SCMOPT_FILTER_FILES, RTGETOPT_REQ_STRING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { "--filter-out-files", SCMOPT_FILTER_OUT_FILES, RTGETOPT_REQ_STRING },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync/** Consider files matching the following patterns (base names only). */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic PFNSCMREWRITER const g_aRewritersFor_Makefile_kup[] =
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic PFNSCMREWRITER const g_aRewritersFor_Makefile_kmk[] =
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic PFNSCMREWRITER const g_aRewritersFor_C_and_CPP[] =
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic PFNSCMREWRITER const g_aRewritersFor_H_and_HPP[] =
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic PFNSCMREWRITER const g_aRewritersFor_ShellScripts[] =
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsyncstatic PFNSCMREWRITER const g_aRewritersFor_BatchFiles[] =
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync { RT_ELEMENTS(g_aRewritersFor_Makefile_kup), &g_aRewritersFor_Makefile_kup[0], "Makefile.kup" },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { RT_ELEMENTS(g_aRewritersFor_Makefile_kmk), &g_aRewritersFor_Makefile_kmk[0], "Makefile.kmk|Config.kmk" },
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync { RT_ELEMENTS(g_aRewritersFor_C_and_CPP), &g_aRewritersFor_C_and_CPP[0], "*.c|*.cpp|*.C|*.CPP|*.cxx|*.cc" },
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync { RT_ELEMENTS(g_aRewritersFor_H_and_HPP), &g_aRewritersFor_H_and_HPP[0], "*.h|*.hpp" },
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync { RT_ELEMENTS(g_aRewritersFor_RC), &g_aRewritersFor_RC[0], "*.rc" },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync { RT_ELEMENTS(g_aRewritersFor_ShellScripts), &g_aRewritersFor_ShellScripts[0], "*.sh|configure" },
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync { RT_ELEMENTS(g_aRewritersFor_BatchFiles), &g_aRewritersFor_BatchFiles[0], "*.bat|*.cmd|*.btm|*.vbs|*.ps1" },
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync/* -=-=-=-=-=- settings -=-=-=-=-=- */
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * Init a settings structure with settings from @a pSrc.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @returns IPRT status code
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @param pSettings The settings.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @param pSrc The source settings.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic int scmSettingsBaseInitAndCopy(PSCMSETTINGSBASE pSettings, PCSCMSETTINGSBASE pSrc)
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync int rc = RTStrDupEx(&pSettings->pszFilterFiles, pSrc->pszFilterFiles);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync rc = RTStrDupEx(&pSettings->pszFilterOutFiles, pSrc->pszFilterOutFiles);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync rc = RTStrDupEx(&pSettings->pszFilterOutDirs, pSrc->pszFilterOutDirs);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * Init a settings structure.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @returns IPRT status code
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @param pSettings The settings.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic int scmSettingsBaseInit(PSCMSETTINGSBASE pSettings)
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync return scmSettingsBaseInitAndCopy(pSettings, &g_Defaults);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * Deletes the settings, i.e. free any dynamically allocated content.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @param pSettings The settings.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic void scmSettingsBaseDelete(PSCMSETTINGSBASE pSettings)
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * Processes a RTGetOpt result.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @retval VINF_SUCCESS if handled.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @retval VERR_OUT_OF_RANGE if the option value was out of range.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @retval VERR_GETOPT_UNKNOWN_OPTION if the option was not recognized.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @param pSettings The settings to change.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @param rc The RTGetOpt return value.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @param pValueUnion The RTGetOpt value union.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic int scmSettingsBaseHandleOpt(PSCMSETTINGSBASE pSettings, int rc, PRTGETOPTUNION pValueUnion)
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync RTMsgError("Invalid tab size: %u - must be in {1..%u}\n",
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync case SCMOPT_FILTER_OUT_DIRS: ppsz = &pSettings->pszFilterOutDirs; break;
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync case SCMOPT_FILTER_FILES: ppsz = &pSettings->pszFilterFiles; break;
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync case SCMOPT_FILTER_OUT_FILES: ppsz = &pSettings->pszFilterOutFiles; break;
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * An empty string zaps the current list.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * Non-empty strings are appended to the pattern list.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * Strip leading and trailing pattern separators before attempting
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * to append it. If it's just separators, don't do anything.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * Parses an option string.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @returns IPRT status code.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @param pBase The base settings structure to apply the options
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @param pszOptions The options to parse.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic int scmSettingsBaseParseString(PSCMSETTINGSBASE pBase, const char *pszLine)
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync int rc = RTGetOptArgvFromString(&papszArgs, &cArgs, pszLine, NULL);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync rc = RTGetOptInit(&GetOptState, cArgs, papszArgs, &g_aScmOpts[0], RT_ELEMENTS(g_aScmOpts), 0, 0 /*fFlags*/);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync while ((rc = RTGetOpt(&GetOptState, &ValueUnion)) != 0)
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync rc = scmSettingsBaseHandleOpt(pBase, rc, &ValueUnion);
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * Parses an unterminated option string.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @returns IPRT status code.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @param pBase The base settings structure to apply the options
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @param pchLine The line.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync * @param cchLine The line length.
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsyncstatic int scmSettingsBaseParseStringN(PSCMSETTINGSBASE pBase, const char *pchLine, size_t cchLine)
ae41886ba231ade1b868dd32ff24ee49813ebbabvboxsync int rc = scmSettingsBaseParseString(pBase, pszLine);
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * Verifies the options string.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @returns IPRT status code.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @param pszOptions The options to verify .
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsyncstatic int scmSettingsBaseVerifyString(const char *pszOptions)
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync rc = scmSettingsBaseParseString(&Base, pszOptions);
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * Loads settings found in editor and SCM settings directives within the
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * document (@a pStream).
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @returns IPRT status code.
b377a71756cce9f39d25b561f72bfa33ce8a39devboxsync * @param pBase The settings base to load settings into.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @param pStream The stream to scan for settings directives.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsyncstatic int scmSettingsBaseLoadFromDocument(PSCMSETTINGSBASE pBase, PSCMSTREAM pStream)
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync /** @todo Editor and SCM settings directives in documents. */
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * Creates a new settings file struct, cloning @a pSettings.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @returns IPRT status code.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @param ppSettings Where to return the new struct.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @param pSettingsBase The settings to inherit from.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsyncstatic int scmSettingsCreate(PSCMSETTINGS *ppSettings, PCSCMSETTINGSBASE pSettingsBase)
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync PSCMSETTINGS pSettings = (PSCMSETTINGS)RTMemAlloc(sizeof(*pSettings));
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync int rc = scmSettingsBaseInitAndCopy(&pSettings->Base, pSettingsBase);
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * Destroys a settings structure.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @param pSettings The settings structure to destroy. NULL is OK.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsyncstatic void scmSettingsDestroy(PSCMSETTINGS pSettings)
0f77dc54d7ec617480988ccdfcd080f480e79698vboxsync * Adds a pattern/options pair to the settings structure.
0f77dc54d7ec617480988ccdfcd080f480e79698vboxsync * @returns IPRT status code.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @param pSettings The settings.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @param pchLine The line containing the unparsed pair.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @param cchLine The length of the line.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsyncstatic int scmSettingsAddPair(PSCMSETTINGS pSettings, const char *pchLine, size_t cchLine)
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * Split the string.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync const char *pchOptions = (const char *)memchr(pchLine, ':', cchLine);
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync /* strip spaces everywhere */
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync while (cchPattern > 0 && RT_C_IS_SPACE(pchLine[cchPattern - 1]))
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync while (cchOptions > 0 && RT_C_IS_SPACE(pchOptions[cchOptions - 1]))
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync while (cchOptions > 0 && RT_C_IS_SPACE(*pchOptions))
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync /* Quietly ignore empty patterns and empty options. */
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * Add the pair and verify the option string.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync void *pvNew = RTMemRealloc(pSettings->paPairs, (iPair + 32) * sizeof(pSettings->paPairs[0]));
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync pSettings->paPairs[iPair].pszPattern = RTStrDupN(pchLine, cchPattern);
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync pSettings->paPairs[iPair].pszOptions = RTStrDupN(pchOptions, cchOptions);
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync rc = scmSettingsBaseVerifyString(pSettings->paPairs[iPair].pszOptions);
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * Loads in the settings from @a pszFilename.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @returns IPRT status code.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @param pSettings Where to load the settings file.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @param pszFilename The file to load.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsyncstatic int scmSettingsLoadFile(PSCMSETTINGS pSettings, const char *pszFilename)
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync int rc = ScmStreamInitForReading(&Stream, pszFilename);
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync RTMsgError("%s: ScmStreamInitForReading -> %Rrc\n", pszFilename, rc);
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync const char *pchLine;
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync while ((pchLine = ScmStreamGetLine(&Stream, &cchLine, &enmEol)) != NULL)
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync /* Ignore leading spaces. */
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync /* Ignore empty lines and comment lines. */
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync /* What kind of line is it? */
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync const char *pchColon = (const char *)memchr(pchLine, ':', cchLine);
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync rc = scmSettingsAddPair(pSettings, pchLine, cchLine);
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync rc = scmSettingsBaseParseStringN(&pSettings->Base, pchLine, cchLine);
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync RTMsgError("%s:%d: %Rrc\n", pszFilename, ScmStreamTellLine(&Stream), rc);
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync RTMsgError("%s: ScmStreamGetStatus- > %Rrc\n", pszFilename, rc);
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * Parse the specified settings file creating a new settings struct from it.
0f77dc54d7ec617480988ccdfcd080f480e79698vboxsync * @returns IPRT status code
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @param ppSettings Where to return the new settings.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @param pszFilename The file to parse.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @param pSettingsBase The base settings we inherit from.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsyncstatic int scmSettingsCreateFromFile(PSCMSETTINGS *ppSettings, const char *pszFilename, PCSCMSETTINGSBASE pSettingsBase)
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync int rc = scmSettingsCreate(&pSettings, pSettingsBase);
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * Create an initial settings structure when starting processing a new file or
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * directory.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * This will look for .scm-settings files from the root and down to the
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * specified directory, combining them into the returned settings structure.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @returns IPRT status code.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @param ppSettings Where to return the pointer to the top stack
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @param pBaseSettings The base settings we inherit from (globals
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * typically).
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * @param pszPath The absolute path to the new directory or file.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsyncstatic int scmSettingsCreateForPath(PSCMSETTINGS *ppSettings, PCSCMSETTINGSBASE pBaseSettings, const char *pszPath)
4aafb1203580a5c145a7bdae57ebf69a36fa4f01vboxsync * We'll be working with a stack copy of the path.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync if (cchDir >= sizeof(szFile) - sizeof(SCM_SETTINGS_FILENAME))
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * Create the bottom-most settings.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync int rc = scmSettingsCreate(&pSettings, pBaseSettings);
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * Enumerate the path components from the root and down. Load any setting
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync * files we find.
bc0c1e33e433d1276ea1606ace81f61594ee3838vboxsync size_t cComponents = RTPathCountComponents(pszPath);
return rc;
if (pOld)
return VINF_SUCCESS;
return rc;
if (pNew)
if (pRet)
return pRet;
while (pCur)
if (cPairs)
return rc;
if (pszFormat)
#define SCM_WITHOUT_LIBSVN
#ifdef SCM_WITHOUT_LIBSVN
static DECLCALLBACK(int) scmSvnFindSvnBinaryCallback(char const *pchPath, size_t cchPath, void *pvUser1, void *pvUser2)
return VINF_SUCCESS;
return VERR_TRY_AGAIN;
#ifdef RT_OS_WINDOWS
if (pszPath)
static int scmSvnConstructName(PSCMRWSTATE pState, const char *pszDir, const char *pszSuff, char *pszDst)
return VINF_SUCCESS;
return rc;
size_t u = 0;
while (cch-- > 0)
*pu = u;
#ifdef SCM_WITHOUT_LIBSVN
if (!pszValue)
return VERR_NOT_FOUND;
if (ppszValue)
return VINF_SUCCESS;
#ifdef SCM_WITHOUT_LIBSVN
const char *pchLine;
|| cchKey == 0
RTMsgError("%s:%u: Unexpected data '%.*s'\n", szPath, ScmStreamTellLine(&Stream), cchLine, pchLine);
if (fMatch)
if (!pchLine)
if (!pchLine)
RTMsgError("%s:%u: Unexpected data '%.*s'\n", szPath, ScmStreamTellLine(&Stream), cchLine, pchLine);
if (fMatch)
if (!ppszValue)
char *pszValue;
return rc;
return VERR_NOT_FOUND;
if (!pszValue)
char *pszCopy;
return rc;
return VINF_SUCCESS;
if (!pvNew)
return VERR_NO_MEMORY;
return VERR_NO_MEMORY;
return VINF_SUCCESS;
if (pszValue)
return VINF_SUCCESS;
#ifdef SCM_WITHOUT_LIBSVN
return VERR_GENERAL_FAILURE;
return rc;
return VINF_SUCCESS;
return VERR_NOT_IMPLEMENTED;
static bool rewrite_StripTrailingBlanks(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
bool fModified = false;
const char *pchLine;
int rc;
if ( cchLine == 0
cchLine--;
cchLine--;
fModified = true;
if (fModified)
return fModified;
static bool rewrite_ExpandTabs(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
bool fModified = false;
const char *pchLine;
int rc;
if (!pchTab)
if (!pchTab)
fModified = true;
if (fModified)
return fModified;
static bool rewrite_ForceEol(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings,
bool fModified = false;
const char *pchLine;
fModified = true;
if (fModified)
char *pszEol;
return fModified;
static bool rewrite_ForceNativeEol(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool rewrite_ForceLF(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool rewrite_ForceCRLF(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool rewrite_AdjustTrailingLines(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
cLinesNew--;
cLinesNew++;
if ( !fFixMissingEol
else if (fFixMissingEol)
static bool rewrite_SvnNoExecutable(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool rewrite_SvnKeywords(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
char *pszKeywords;
static bool rewrite_Makefile_kup(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool rewrite_Makefile_kmk(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool rewrite_C_and_CPP(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static int scmProcessFileInner(PSCMRWSTATE pState, const char *pszFilename, const char *pszBasename, size_t cchBasename,
&& !RTStrSimplePatternMultiMatch(pBaseSettings->pszFilterFiles, RTSTR_MAX, pszBasename, cchBasename, NULL))
return VINF_SUCCESS;
&& ( RTStrSimplePatternMultiMatch(pBaseSettings->pszFilterOutFiles, RTSTR_MAX, pszBasename, cchBasename, NULL)
|| RTStrSimplePatternMultiMatch(pBaseSettings->pszFilterOutFiles, RTSTR_MAX, pszFilename, RTSTR_MAX, NULL)) )
return VINF_SUCCESS;
return VINF_SUCCESS;
if (RTStrSimplePatternMultiMatch(g_aConfigs[iCfg].pszFilePattern, RTSTR_MAX, pszBasename, cchBasename, NULL))
if (!pCfg)
return VINF_SUCCESS;
return rc;
bool fModified = false;
if (fRc)
fModified = true;
if (fModified)
if (!g_fDryRun)
if (!g_fDryRun)
return rc;
int rc = scmSettingsStackMakeFileBase(pSettingsStack, pszFilename, pszBasename, cchBasename, &Base);
return rc;
return RTDIRENTRYTYPE_UNKNOWN;
return RTDIRENTRYTYPE_DIRECTORY;
return RTDIRENTRYTYPE_FILE;
return RTDIRENTRYTYPE_UNKNOWN;
int rc;
return rc;
return VINF_SUCCESS;
return rc;
return rc;
return rc;
if (pszBasename)
return rc;
memcpy(&s_aOpts[RT_ELEMENTS(s_aOpts) - RT_ELEMENTS(g_aScmOpts)], &g_aScmOpts[0], sizeof(g_aScmOpts));
rc = RTGetOptInit(&GetOptState, argc, argv, &s_aOpts[0], RT_ELEMENTS(s_aOpts), 1, RTGETOPTINIT_FLAGS_OPTS_FIRST);
switch (rc)
g_fDryRun = true;
g_fDryRun = false;
bool fAdvanceTwo = false;
if (fAdvanceTwo)
case SCMOPT_FORCE_TRAILING_LINE: RTPrintf(" Default: %RTbool\n", g_Defaults.fForceTrailingLine); break;
case SCMOPT_STRIP_TRAILING_BLANKS: RTPrintf(" Default: %RTbool\n", g_Defaults.fStripTrailingBlanks); break;
case SCMOPT_STRIP_TRAILING_LINES: RTPrintf(" Default: %RTbool\n", g_Defaults.fStripTrailingLines); break;
case SCMOPT_SET_SVN_EXECUTABLE: RTPrintf(" Default: %RTbool\n", g_Defaults.fSetSvnExecutable); break;
i += fAdvanceTwo;
g_iVerbosity = 0;
g_iVerbosity++;
case SCMOPT_DIFF_IGNORE_EOL:
g_fDiffIgnoreEol = true;
g_fDiffIgnoreEol = false;
case SCMOPT_DIFF_IGNORE_SPACE:
g_fDiffIgnoreLeadingWS = true;
g_fDiffIgnoreLeadingWS = false;
g_fDiffIgnoreTrailingWS = true;
g_fDiffIgnoreTrailingWS = false;
g_fDiffSpecialChars = true;
g_fDiffSpecialChars = false;
case VINF_GETOPT_NOT_OPTION:
if (!g_fDryRun)
if (!cProcessed)
cProcessed++;
return rc;