Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | By default, the changes and status commands list all changed files relative to the current working directory, unless the --non-relative option is used. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | ben-changes-report |
Files: | files | file ages | folders |
SHA1: |
a05bbff46acb84964af5aaae53b11f69 |
User & Date: | ben 2011-07-10 15:01:34.606 |
Context
2011-07-11
| ||
10:00 | By default, the extras command lists all the uncontrolled files relative to the current working directory, unless the --non-relative option is used. ... (check-in: b9a38cf3 user: ben tags: ben-changes-report) | |
2011-07-10
| ||
15:01 | By default, the changes and status commands list all changed files relative to the current working directory, unless the --non-relative option is used. ... (check-in: a05bbff4 user: ben tags: ben-changes-report) | |
13:01 | When running the changes or status command from inside a sub-directory of the check out, only show the changes in or below the current directory unless the --show-all option is used. ... (check-in: e0d2e1f9 user: ben tags: ben-changes-report) | |
Changes
Changes to src/checkin.c.
︙ | ︙ | |||
31 32 33 34 35 36 37 | ** If missingIsFatal is true, then any files that are missing or which ** are not true files results in a fatal error. */ static void status_report( Blob *report, /* Append the status report here */ const char *zPrefix, /* Prefix on each line of the report */ int missingIsFatal, /* MISSING and NOT_A_FILE are fatal errors */ | | | < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < > > > > > > > | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | ** If missingIsFatal is true, then any files that are missing or which ** are not true files results in a fatal error. */ static void status_report( Blob *report, /* Append the status report here */ const char *zPrefix, /* Prefix on each line of the report */ int missingIsFatal, /* MISSING and NOT_A_FILE are fatal errors */ int cwdRelative /* Report relative to the current working dir */ ){ Stmt q; int nPrefix = strlen(zPrefix); int nErr = 0; Blob rewrittenPathname; db_prepare(&q, "SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)" " FROM vfile " " WHERE file_is_selected(id)" " AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1" ); blob_zero(&rewrittenPathname); while( db_step(&q)==SQLITE_ROW ){ const char *zPathname = db_column_text(&q,0); const char *zDisplayName = zPathname; int isDeleted = db_column_int(&q, 1); int isChnged = db_column_int(&q,2); int isNew = db_column_int(&q,3)==0; int isRenamed = db_column_int(&q,4); char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname); if( cwdRelative ){ file_relative_name(zFullName, &rewrittenPathname); 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_isfile(zFullName) ){ if( file_access(zFullName, 0)==0 ){ blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName); if( missingIsFatal ){ |
︙ | ︙ | |||
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | }else if( isChnged==1 ){ blob_appendf(report, "EDITED %s\n", zDisplayName); }else if( isRenamed ){ blob_appendf(report, "RENAMED %s\n", zDisplayName); } free(zFullName); } db_finalize(&q); db_prepare(&q, "SELECT uuid FROM vmerge JOIN blob ON merge=rid" " WHERE id=0"); while( db_step(&q)==SQLITE_ROW ){ blob_append(report, zPrefix, nPrefix); blob_appendf(report, "MERGED_WITH %s\n", db_column_text(&q, 0)); } db_finalize(&q); | > < < < | | | | | 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 141 142 143 144 | }else if( isChnged==1 ){ blob_appendf(report, "EDITED %s\n", zDisplayName); }else if( isRenamed ){ blob_appendf(report, "RENAMED %s\n", zDisplayName); } free(zFullName); } blob_reset(&rewrittenPathname); db_finalize(&q); db_prepare(&q, "SELECT uuid FROM vmerge JOIN blob ON merge=rid" " WHERE id=0"); while( db_step(&q)==SQLITE_ROW ){ blob_append(report, zPrefix, nPrefix); blob_appendf(report, "MERGED_WITH %s\n", db_column_text(&q, 0)); } db_finalize(&q); if( nErr ){ fossil_fatal("aborting due to prior errors"); } } /* ** COMMAND: changes ** ** Usage: %fossil changes ** ** Report on the edit status of all files in the current checkout. ** See also the "status" and "extra" commands. ** ** Options: ** ** --sha1sum Verify file status using SHA1 hashing rather ** than relying on file mtimes. ** ** --non-relative Don't display filenames relative to the current ** working directory. */ void changes_cmd(void){ Blob report; int vid; int useSha1sum = find_option("sha1sum", 0, 0)!=0; int nonRelative = find_option("non-relative", 0, 0)!=0; db_must_be_within_tree(); blob_zero(&report); vid = db_lget_int("checkout", 0); vfile_check_signature(vid, 0, useSha1sum); status_report(&report, "", 0, !nonRelative); blob_write_to_file(&report, "-"); } /* ** COMMAND: status ** ** Usage: %fossil status |
︙ | ︙ |