Fossil

Check-in [5775d376]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Change -unmodified/UNMODIFIED to -unchanged/UNCHANGED in status_report() for consistency with the ls -v command
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | andygoth-changes
Files: files | file ages | folders
SHA1: 5775d3761f5180c1b582fc2ea416be42059efaab
User & Date: andygoth 2016-11-06 04:17:15
Context
2016-11-06
04:23
Remove stale TODO comment. May still want to implement ls in terms of status_report() though. check-in: bfb7dd2a user: andygoth tags: andygoth-changes
04:17
Change -unmodified/UNMODIFIED to -unchanged/UNCHANGED in status_report() for consistency with the ls -v command check-in: 5775d376 user: andygoth tags: andygoth-changes
04:13
Minor optimization to status_report() to avoid building list of managed files if only unmanaged files are requested. Move unmanaged file reserved name filtering to status_report(). Ensure db_get*() calls happen after db_must_be_within_tree(). Implement extras_cmd() in terms of status_report(). check-in: d52fd185 user: andygoth tags: andygoth-changes
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/checkin.c.

    23     23   #include <assert.h>
    24     24   
    25     25   /*
    26     26   ** Change filter options.
    27     27   */
    28     28   enum {
    29     29     /* Zero-based bit indexes. */
    30         -  CB_EDITED , CB_UPDATED , CB_CHANGED, CB_MISSING   , CB_ADDED, CB_DELETED,
    31         -  CB_RENAMED, CB_CONFLICT, CB_META   , CB_UNMODIFIED, CB_EXTRA, CB_MERGE  ,
    32         -  CB_RELPATH, CB_CLASSIFY, CB_FATAL  , CB_COMMENT   ,
           30  +  CB_EDITED , CB_UPDATED , CB_CHANGED, CB_MISSING  , CB_ADDED, CB_DELETED,
           31  +  CB_RENAMED, CB_CONFLICT, CB_META   , CB_UNCHANGED, CB_EXTRA, CB_MERGE  ,
           32  +  CB_RELPATH, CB_CLASSIFY, CB_FATAL  , CB_COMMENT  ,
    33     33   
    34     34     /* Bitmask values. */
    35     35     C_EDITED     = 1 << CB_EDITED,    /* Edited, merged, and conflicted files. */
    36     36     C_UPDATED    = 1 << CB_UPDATED,   /* Files updated by merge/integrate. */
    37     37     C_CHANGED    = 1 << CB_CHANGED,   /* Treated the same as the above two. */
    38     38     C_MISSING    = 1 << CB_MISSING,   /* Missing and non- files. */
    39     39     C_ADDED      = 1 << CB_ADDED,     /* Added files. */
    40     40     C_DELETED    = 1 << CB_DELETED,   /* Deleted files. */
    41     41     C_RENAMED    = 1 << CB_RENAMED,   /* Renamed files. */
    42     42     C_CONFLICT   = 1 << CB_CONFLICT,  /* Files having merge conflicts. */
    43     43     C_META       = 1 << CB_META,      /* Files with metadata changes. */
    44         -  C_UNMODIFIED = 1 << CB_UNMODIFIED,/* Unmodified files. */
           44  +  C_UNCHANGED  = 1 << CB_UNCHANGED, /* Unchanged files. */
    45     45     C_EXTRA      = 1 << CB_EXTRA,     /* Unmanaged files. */
    46     46     C_MERGE      = 1 << CB_MERGE,     /* Merge contributors. */
    47     47     C_FILTER     = C_EDITED  | C_UPDATED | C_CHANGED  | C_MISSING | C_ADDED
    48         -               | C_DELETED | C_RENAMED | C_CONFLICT | C_META    | C_UNMODIFIED
           48  +               | C_DELETED | C_RENAMED | C_CONFLICT | C_META    | C_UNCHANGED
    49     49                  | C_EXTRA   | C_MERGE,
    50     50     C_ALL        = C_FILTER & ~(C_EXTRA | C_MERGE),
    51     51     C_RELPATH    = 1 << CB_RELPATH,   /* Show relative paths. */
    52     52     C_CLASSIFY   = 1 << CB_CLASSIFY,  /* Show file change types. */
    53         -  C_DEFAULT    = (C_ALL & ~C_UNMODIFIED) | C_MERGE | C_CLASSIFY,
           53  +  C_DEFAULT    = (C_ALL & ~C_UNCHANGED) | C_MERGE | C_CLASSIFY,
    54     54     C_FATAL      = (1 << CB_FATAL) | C_MISSING, /* Fail on MISSING/NOT_A_FILE. */
    55     55     C_COMMENT    = 1 << CB_COMMENT,   /* Precede each line with "# ". */
    56     56   };
    57     57   
    58     58   /*
    59     59   ** Create a TEMP table named SFILE and add all unmanaged files named on
    60     60   ** the command-line to that table.  If directories are named, then add
................................................................................
   144    144       /* Start with a list of all managed files. */
   145    145       blob_append_sql(&sql,
   146    146         "SELECT pathname, deleted, chnged, rid,"
   147    147         "       coalesce(origname!=pathname,0) AS renamed, islink, 1 AS managed"
   148    148         "  FROM vfile"
   149    149         " WHERE is_selected(id)%s", blob_sql_text(&where));
   150    150   
   151         -    /* Exclude unmodified files unless requested. */
   152         -    if( !(flags & C_UNMODIFIED) ){
          151  +    /* Exclude unchanged files unless requested. */
          152  +    if( !(flags & C_UNCHANGED) ){
   153    153         blob_append_sql(&sql,
   154    154             " AND (chnged OR deleted OR rid=0 OR pathname!=origname)");
   155    155       }
   156    156     }
   157    157   
   158    158     /* If C_EXTRA, add unmanaged files to the query result too. */
   159    159     if( flags & C_EXTRA ){
................................................................................
   224    224              && file_contains_merge_marker(zFullName) ){
   225    225         zClass = "CONFLICT";
   226    226       }else if( (flags & (C_EDITED | C_CHANGED)) && isChnged
   227    227              && (isChnged<2 || isChnged>9) ){
   228    228         zClass = "EDITED";
   229    229       }else if( (flags & C_RENAMED) && isRenamed ){
   230    230         zClass = "RENAMED";
   231         -    }else if( (flags & C_UNMODIFIED) && isManaged && !isDeleted && !isMissing
   232         -                                     && !isNew    && !isChnged  && !isRenamed ){
   233         -      zClass = "UNMODIFIED";
          231  +    }else if( (flags & C_UNCHANGED) && isManaged && !isDeleted && !isMissing
          232  +                                    && !isNew    && !isChnged  && !isRenamed ){
          233  +      zClass = "UNCHANGED";
   234    234       }else if( (flags & C_EXTRA) && !isManaged ){
   235    235         zClass = "EXTRA";
   236    236       }
   237    237       /* TODO: reimplement ls and extras in terms of this function. */
   238    238   
   239    239       /* Only report files for which a change classification was determined. */
   240    240       if( zClass ){
................................................................................
   389    389   **    --changed         Combination of the above two options.
   390    390   **    --missing         Display missing files.
   391    391   **    --added           Display added files.
   392    392   **    --deleted         Display deleted files.
   393    393   **    --renamed         Display renamed files.
   394    394   **    --conflict        Display files having merge conflicts.
   395    395   **    --meta            Display files with metadata changes.
   396         -**    --unmodified      Display unmodified files.
          396  +**    --unchanged       Display unchanged files.
   397    397   **    --all             Display all managed files, i.e. all of the above.
   398    398   **    --extra           Display unmanaged files.
   399    399   **    --merge           Display merge contributors.
   400    400   **    --no-merge        Do not display merge contributors.
   401    401   **
   402    402   ** See also: extras, ls
   403    403   */
................................................................................
   408    408       unsigned mask;
   409    409       int changesOnly;
   410    410     } flagDefs[] = {
   411    411       {"edited"  , C_EDITED , 0}, {"updated"    , C_UPDATED   , 0},
   412    412       {"changed" , C_CHANGED, 0}, {"missing"    , C_MISSING   , 0},
   413    413       {"added"   , C_ADDED  , 0}, {"deleted"    , C_DELETED   , 0},
   414    414       {"renamed" , C_RENAMED, 0}, {"conflict"   , C_CONFLICT  , 0},
   415         -    {"meta"    , C_META   , 0}, {"unmodified" , C_UNMODIFIED, 0},
          415  +    {"meta"    , C_META   , 0}, {"unchanged"  , C_UNCHANGED , 0},
   416    416       {"all"     , C_ALL    , 0}, {"extra"      , C_EXTRA     , 0},
   417    417       {"merge"   , C_MERGE  , 0}, {"classify"   , C_CLASSIFY  , 1},
   418    418     }, noFlagDefs[] = {
   419    419       {"no-merge", C_MERGE  , 0}, {"no-classify", C_CLASSIFY  , 1},
   420    420     };
   421    421   
   422    422     Blob report = BLOB_INITIALIZER;