VirtualBox

Changeset 26516 in vbox


Ignore:
Timestamp:
Feb 14, 2010 9:37:33 PM (15 years ago)
Author:
vboxsync
Message:

scm: --only-svn-dirs.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/.scm-settings

    r26515 r26516  
    2828
    2929#
     30# Global settings.
     31#
     32--only-svn-dirs
     33
     34#
    3035# Directories to ignore.
    3136#
     
    3540#
    3641--filter-out-dirs  ".svn"
    37 --filter-out-dirs  "*/out/."
     42--filter-out-dirs  "*/*out*/."
    3843--filter-out-dirs  "*/tools/."
    3944--filter-out-dirs  "*/webtools/."
     
    7580--filter-out-files "*/src/VBox/HostDrivers/VBoxUSB/os2/usbcalls.h"
    7681--filter-out-files "*/src/VBox/RDP/x11server/Init*.c"
     82--filter-out-files "*/vslick.h"
    7783
    7884
  • trunk/src/bldprogs/scm.cpp

    r26507 r26516  
    208208    bool            fStripTrailingBlanks;
    209209    bool            fStripTrailingLines;
     210    /** Only recurse into directories containing an .svn dir.  */
     211    bool            fOnlySvnDirs;
     212    /**  */
    210213    unsigned        cchTab;
    211    /** Only consider files matcihng these patterns.  This is only applied to the
    212     *  base names. */
     214    /** Only consider files matcihng these patterns.  This is only applied to the
     215     *  base names. */
    213216    char           *pszFilterFiles;
    214    /** Filter out files matching the following patterns.  This is applied to base
    215     *  names as well as the aboslute paths.  */
     217    /** Filter out files matching the following patterns.  This is applied to base
     218     *  names as well as the aboslute paths.  */
    216219    char           *pszFilterOutFiles;
    217    /** Filter out directories matching the following patterns.  This is applied
    218     *  to base names as well as the aboslute paths.  All absolute paths ends with a
    219     *  slash and dot ("/.").  */
     220    /** Filter out directories matching the following patterns.  This is applied
     221     *  to base names as well as the aboslute paths.  All absolute paths ends with a
     222     *  slash and dot ("/.").  */
    220223    char           *pszFilterOutDirs;
    221224} SCMSETTINGSBASE;
     
    245248    SCMOPT_STRIP_TRAILING_LINES,
    246249    SCMOPT_NO_STRIP_TRAILING_LINES,
     250    SCMOPT_ONLY_SVN_DIRS,
     251    SCMOPT_NOT_ONLY_SVN_DIRS,
    247252    SCMOPT_TAB_SIZE,
    248253    SCMOPT_FILTER_OUT_DIRS,
     
    349354    /* .fStripTrailingBlanks = */   true,
    350355    /* .fStripTrailingLines = */    true,
     356    /* .fOnlySvnDirs = */           false,
    351357    /* .cchTab = */                 8,
    352358    /* .pszFilterFiles = */         (char *)"",
     
    370376    { "--strip-trailing-lines",             SCMOPT_STRIP_TRAILING_LINES,            RTGETOPT_REQ_NOTHING },
    371377    { "--strip-no-trailing-lines",          SCMOPT_NO_STRIP_TRAILING_LINES,         RTGETOPT_REQ_NOTHING },
     378    { "--only-svn-dirs",                    SCMOPT_ONLY_SVN_DIRS,                   RTGETOPT_REQ_NOTHING },
     379    { "--not-only-svn-dirs",                SCMOPT_NOT_ONLY_SVN_DIRS,               RTGETOPT_REQ_NOTHING },
    372380    { "--tab-size",                         SCMOPT_TAB_SIZE,                        RTGETOPT_REQ_UINT8   },
    373381    { "--filter-out-dirs",                  SCMOPT_FILTER_OUT_DIRS,                 RTGETOPT_REQ_STRING  },
     
    18271835        case SCMOPT_NO_STRIP_TRAILING_LINES:
    18281836            pSettings->fStripTrailingLines = false;
     1837            return VINF_SUCCESS;
     1838
     1839        case SCMOPT_ONLY_SVN_DIRS:
     1840            pSettings->fOnlySvnDirs = true;
     1841            return VINF_SUCCESS;
     1842        case SCMOPT_NOT_ONLY_SVN_DIRS:
     1843            pSettings->fOnlySvnDirs = false;
    18291844            return VINF_SUCCESS;
    18301845
     
    29302945                                      PSCMSETTINGS pSettingsStack, unsigned iRecursion)
    29312946{
     2947    int rc;
    29322948    Assert(cchDir > 1 && pszBuf[cchDir - 1] == '.');
    29332949
     
    29422958
    29432959    /*
     2960     * Check if it's excluded by --only-svn-dir.
     2961     */
     2962    if (pSettingsStack->Base.fOnlySvnDirs)
     2963    {
     2964        rc = RTPathAppend(pszBuf, RTPATH_MAX, ".svn");
     2965        if (RT_FAILURE(rc))
     2966        {
     2967            RTMsgError("RTPathAppend: %Rrc\n", rc);
     2968            return rc;
     2969        }
     2970        if (!RTDirExists(pszBuf))
     2971            return VINF_SUCCESS;
     2972
     2973        Assert(RTPATH_IS_SLASH(pszBuf[cchDir]));
     2974        pszBuf[cchDir]     = '\0';
     2975        pszBuf[cchDir - 1] = '.';
     2976    }
     2977
     2978    /*
    29442979     * Try open and read the directory.
    29452980     */
    29462981    PRTDIR pDir;
    2947     int rc = RTDirOpenFiltered(&pDir, pszBuf, RTDIRFILTER_NONE);
     2982    rc = RTDirOpenFiltered(&pDir, pszBuf, RTDIRFILTER_NONE);
    29482983    if (RT_FAILURE(rc))
    29492984    {
     
    31463181                g_fDryRun = true;
    31473182                break;
    3148 
    31493183            case 'D':
    31503184                g_fDryRun = false;
     
    31563190
    31573191            case 'h':
    3158                 RTPrintf("Source Code Massager\n"
     3192                RTPrintf("VirtualBox Source Code Massager\n"
    31593193                         "\n"
    31603194                         "Usage: %s [options] <files & dirs>\n"
     
    31663200                    if ((s_aOpts[i].fFlags & RTGETOPT_REQ_MASK) == RTGETOPT_REQ_NOTHING)
    31673201                    {
    3168                         if ((fAdvanceTwo = i + 1 < RT_ELEMENTS(s_aOpts) && strstr(s_aOpts[i+1].pszLong, "-no-") != NULL))
     3202                        fAdvanceTwo = i + 1 < RT_ELEMENTS(s_aOpts)
     3203                                   && (   strstr(s_aOpts[i+1].pszLong, "-no-") != NULL
     3204                                       || strstr(s_aOpts[i+1].pszLong, "-not-") != NULL);
     3205                        if (fAdvanceTwo)
    31693206                            RTPrintf("  %s, %s\n", s_aOpts[i].pszLong, s_aOpts[i + 1].pszLong);
    31703207                        else
     
    31833220                        case SCMOPT_STRIP_TRAILING_BLANKS:  RTPrintf("      Default: %RTbool\n", g_Defaults.fStripTrailingBlanks); break;
    31843221                        case SCMOPT_STRIP_TRAILING_LINES:   RTPrintf("      Default: %RTbool\n", g_Defaults.fStripTrailingLines); break;
     3222                        case SCMOPT_ONLY_SVN_DIRS:          RTPrintf("      Default: %RTbool\n", g_Defaults.fOnlySvnDirs); break;
    31853223                        case SCMOPT_TAB_SIZE:               RTPrintf("      Default: %u\n", g_Defaults.cchTab); break;
    31863224                        case SCMOPT_FILTER_OUT_DIRS:        RTPrintf("      Default: %s\n", g_Defaults.pszFilterOutDirs); break;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette