Check-in [c41d70dccd]
Not logged in

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

Overview
Comment:Better outlining of output from "fossil status", "fossil changes" and "fossil ls --verbose". Let "fossil ls --verbose" differentiate between EDITED, CONFLICT, UPD_BY_MERGE and ADD_BY_MERGE, just like "fossil status" and "fossil changes"
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c41d70dccd14b619ebbe5a6069b8e4f37aec0987
User & Date: jan.nijtmans 2013-07-22 08:55:44
Context
2013-07-22
09:37
Eliminate some unused variables. "int const" -> "const int" and "char const" -> "const char" check-in: b2640f61d7 user: jan.nijtmans tags: trunk
09:23
rebase Leaf check-in: 7b7a4bd579 user: jan.nijtmans tags: merge-integrate
08:55
Better outlining of output from "fossil status", "fossil changes" and "fossil ls --verbose". Let "fossil ls --verbose" differentiate between EDITED, CONFLICT, UPD_BY_MERGE and ADD_BY_MERGE, just like "fossil status" and "fossil changes" check-in: c41d70dccd user: jan.nijtmans tags: trunk
2013-07-21
16:38
Expanded "search" command flags: (-limit|-n #) limits the number of results and (-all|-a) disables the "lopping off" of the bottom fraction of the results. check-in: 1064dfac12 user: stephan tags: trunk
Changes

Changes to src/checkin.c.

82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107

108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
...
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332







333

334
335
336
337
338
339
340
341
342
343
344
      zDisplayName = blob_str(&rewrittenPathname);
      if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
        zDisplayName += 2;  /* no unnecessary ./ prefix */
      }
    }
    blob_append(report, zPrefix, nPrefix);
    if( isDeleted ){
      blob_appendf(report, "DELETED    %s\n", zDisplayName);
    }else if( !file_wd_isfile_or_link(zFullName) ){
      if( file_access(zFullName, 0)==0 ){
        blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName);
        if( missingIsFatal ){
          fossil_warning("not a file: %s", zDisplayName);
          nErr++;
        }
      }else{
        blob_appendf(report, "MISSING    %s\n", zDisplayName);
        if( missingIsFatal ){
          fossil_warning("missing file: %s", zDisplayName);
          nErr++;
        }
      }
    }else if( isNew ){
      blob_appendf(report, "ADDED      %s\n", zDisplayName);
    }else if( isDeleted ){
      blob_appendf(report, "DELETED    %s\n", zDisplayName);

    }else if( isChnged==2 ){
      blob_appendf(report, "UPDATED_BY_MERGE %s\n", zDisplayName);
    }else if( isChnged==3 ){
      blob_appendf(report, "ADDED_BY_MERGE %s\n", zDisplayName);
    }else if( isChnged==1 ){
      if( file_contains_merge_marker(zFullName) ){
        blob_appendf(report, "CONFLICT   %s\n", zDisplayName);
      }else{
        blob_appendf(report, "EDITED     %s\n", zDisplayName);
      }
    }else if( isRenamed ){
      blob_appendf(report, "RENAMED    %s\n", zDisplayName);
    }else{
      report->nUsed -= nPrefix;
    }
    free(zFullName);
  }
  blob_reset(&rewrittenPathname);
  db_finalize(&q);
  db_prepare(&q, "SELECT uuid, id FROM vmerge JOIN blob ON merge=rid"
                 " WHERE id<=0");
  while( db_step(&q)==SQLITE_ROW ){
    const char *zLabel = "MERGED_WITH";
    switch( db_column_int(&q, 1) ){
      case -1:  zLabel = "CHERRYPICK";  break;
      case -2:  zLabel = "BACKOUT   ";  break;
    }
    blob_append(report, zPrefix, nPrefix);
    blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
  }
  db_finalize(&q);
  if( nErr ){
    fossil_fatal("aborting due to prior errors");
................................................................................
    int isNew = db_column_int(&q,2)==0;
    int chnged = db_column_int(&q,3);
    int renamed = db_column_int(&q,4);
    char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
    const char *type = "";
    if( verboseFlag ){
      if( isNew ){
        type = "ADDED      ";
      }else if( isDeleted ){
        type = "DELETED    ";
      }else if( !file_wd_isfile_or_link(zFullName) ){
        if( file_access(zFullName, 0)==0 ){
          type = "NOT_A_FILE ";
        }else{
          type = "MISSING    ";
        }
      }else if( chnged ){







        type = "EDITED     ";

      }else if( renamed ){
        type = "RENAMED    ";
      }else{
        type = "UNCHANGED  ";
      }
    }
    if( showAge ){
      fossil_print("%s%s  %s\n", type, db_column_text(&q, 5), zPathname);
    }else{
      fossil_print("%s%s\n", type, zPathname);
    }







|


|





|






|

|
>
|
|
|
|
<
|
|

|


|












|
|







 







|

|


|

|


>
>
>
>
>
>
>
|
>

|

|







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112

113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
...
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
      zDisplayName = blob_str(&rewrittenPathname);
      if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
        zDisplayName += 2;  /* no unnecessary ./ prefix */
      }
    }
    blob_append(report, zPrefix, nPrefix);
    if( isDeleted ){
      blob_appendf(report, "DELETED       %s\n", zDisplayName);
    }else if( !file_wd_isfile_or_link(zFullName) ){
      if( file_access(zFullName, 0)==0 ){
        blob_appendf(report, "NOT_A_FILE    %s\n", zDisplayName);
        if( missingIsFatal ){
          fossil_warning("not a file: %s", zDisplayName);
          nErr++;
        }
      }else{
        blob_appendf(report, "MISSING       %s\n", zDisplayName);
        if( missingIsFatal ){
          fossil_warning("missing file: %s", zDisplayName);
          nErr++;
        }
      }
    }else if( isNew ){
      blob_appendf(report, "ADDED         %s\n", zDisplayName);
    }else if( isDeleted ){
      blob_appendf(report, "DELETED       %s\n", zDisplayName);
    }else if( isChnged ){
      if( isChnged==2 ){
        blob_appendf(report, "UPD_BY_MERGE  %s\n", zDisplayName);
      }else if( isChnged==3 ){
        blob_appendf(report, "ADD_BY_MERGE  %s\n", zDisplayName);

      }else if( file_contains_merge_marker(zFullName) ){
        blob_appendf(report, "CONFLICT      %s\n", zDisplayName);
      }else{
        blob_appendf(report, "EDITED        %s\n", zDisplayName);
      }
    }else if( isRenamed ){
      blob_appendf(report, "RENAMED       %s\n", zDisplayName);
    }else{
      report->nUsed -= nPrefix;
    }
    free(zFullName);
  }
  blob_reset(&rewrittenPathname);
  db_finalize(&q);
  db_prepare(&q, "SELECT uuid, id FROM vmerge JOIN blob ON merge=rid"
                 " WHERE id<=0");
  while( db_step(&q)==SQLITE_ROW ){
    const char *zLabel = "MERGED_WITH";
    switch( db_column_int(&q, 1) ){
      case -1:  zLabel = "CHERRYPICK ";  break;
      case -2:  zLabel = "BACKOUT    ";  break;
    }
    blob_append(report, zPrefix, nPrefix);
    blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
  }
  db_finalize(&q);
  if( nErr ){
    fossil_fatal("aborting due to prior errors");
................................................................................
    int isNew = db_column_int(&q,2)==0;
    int chnged = db_column_int(&q,3);
    int renamed = db_column_int(&q,4);
    char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
    const char *type = "";
    if( verboseFlag ){
      if( isNew ){
        type = "ADDED         ";
      }else if( isDeleted ){
        type = "DELETED       ";
      }else if( !file_wd_isfile_or_link(zFullName) ){
        if( file_access(zFullName, 0)==0 ){
          type = "NOT_A_FILE    ";
        }else{
          type = "MISSING       ";
        }
      }else if( chnged ){
        if( chnged==2 ){
          type = "UPD_BY_MERGE  ";
        }else if( chnged==3 ){
          type = "ADD_BY_MERGE  ";
        }else if( file_contains_merge_marker(zFullName) ){
          type = "CONFLICT      ";
        }else{
          type = "EDITED        ";
        }
      }else if( renamed ){
        type = "RENAMED       ";
      }else{
        type = "UNCHANGED     ";
      }
    }
    if( showAge ){
      fossil_print("%s%s  %s\n", type, db_column_text(&q, 5), zPathname);
    }else{
      fossil_print("%s%s\n", type, zPathname);
    }